Re: Small glitch in spellchecker (trunk)

2010-09-18 Thread Stephan Witt
Am 17.09.2010 um 19:44 schrieb Kornel Benko:

> Am Freitag 17 September 2010 schrieb Kornel Benko:
>> I attach a test-case. The spell-checker even marks the word as english
>> after accepting ...
> 
> But this happens only, if continuous spellchecking is set.

I have a problem and asking for help with cmake:

The hunspell library I use is self compiled and doesn't exist below /usr or 
/usr/local.
So it cannot be found by cmake - as it currently is searched for.
What should I do to change that. I tried to add my directory to some path here 
or there.
But I cannot get it working and I have no clue how private library/header files 
should be handled.

Please, can anybody of the cmake gurus help here?

Stephan

Re: Small glitch in spellchecker (trunk)

2010-09-18 Thread Kornel Benko
Am Freitag 17 September 2010 schrieb Kornel Benko:
> Am Freitag 17 September 2010 schrieb Kornel Benko:
> > I attach a test-case. The spell-checker even marks the word as english
> > after accepting ...
> 
> But this happens only, if continuous spellchecking is set.
> 
>   Kornel

Now it's working again.

1.) I added
check_learned = true;
  prior to the patch of Stephan

2.) Check the new lyx, it is working.

3.) reverting the change

4.) lyx STILL working (Now this is the case you Stephan have.

From now on I was unable to put it to my previous erroneous state.

Is there something cached? Through sessions?

Kornel


signature.asc
Description: This is a digitally signed message part.


Re: Small glitch in spellchecker (trunk)

2010-09-18 Thread Stephan Witt
Am 18.09.2010 um 09:12 schrieb Kornel Benko:

> Am Freitag 17 September 2010 schrieb Kornel Benko:
>> Am Freitag 17 September 2010 schrieb Kornel Benko:
>>> I attach a test-case. The spell-checker even marks the word as english
>>> after accepting ...
>> 
>> But this happens only, if continuous spellchecking is set.
>> 
>>  Kornel
> 
> Now it's working again.
> 
> 1.) I added
>   check_learned = true;
>  prior to the patch of Stephan
> 
> 2.) Check the new lyx, it is working.
> 
> 3.) reverting the change
> 
> 4.) lyx STILL working (Now this is the case you Stephan have.
> 
> From now on I was unable to put it to my previous erroneous state.
> 
> Is there something cached? Through sessions?

There is a non-persistent cache per paragraph for the positions of spell errors.
This cache is bypassed with check_learned = true for word-wise checks.
The cache is not written to disk - at least I have not coded that.
I'll see if the cache is not invalidated when you accept a suggestion of the 
speller.

Stephan

Re: Small glitch in spellchecker (trunk)

2010-09-18 Thread Kornel Benko
Am Samstag 18 September 2010 schrieb Stephan Witt:
> Am 17.09.2010 um 19:44 schrieb Kornel Benko:
> > Am Freitag 17 September 2010 schrieb Kornel Benko:
> >> I attach a test-case. The spell-checker even marks the word as english
> >> after accepting ...
> > 
> > But this happens only, if continuous spellchecking is set.
> 
> I have a problem and asking for help with cmake:
> 
> The hunspell library I use is self compiled and doesn't exist below /usr or
> /usr/local. So it cannot be found by cmake - as it currently is searched
> for.
> What should I do to change that. I tried to add my directory to some path
> here or there. But I cannot get it working and I have no clue how private
> library/header files should be handled.
> 
> Please, can anybody of the cmake gurus help here?
> 
> Stephan

You could patch the module development/cmake/modules/FindHunspell.cmake
to add your desired path.

For libraries and for include files

Kornel


signature.asc
Description: This is a digitally signed message part.


Re: Small glitch in spellchecker (trunk)

2010-09-18 Thread Stephan Witt
Am 18.09.2010 um 09:39 schrieb Kornel Benko:

> Am Samstag 18 September 2010 schrieb Stephan Witt:
>> Am 17.09.2010 um 19:44 schrieb Kornel Benko:
>>> Am Freitag 17 September 2010 schrieb Kornel Benko:
>> The hunspell library I use is self compiled and doesn't exist below /usr or
>> /usr/local. So it cannot be found by cmake - as it currently is searched
>> for.
>> What should I do to change that. I tried to add my directory to some path
>> here or there. But I cannot get it working and I have no clue how private
>> library/header files should be handled.
>> 
>> Please, can anybody of the cmake gurus help here?
>> 
>> Stephan
> 
> You could patch the module development/cmake/modules/FindHunspell.cmake
> to add your desired path.
> 
> For libraries and for include files

Thanks, now it works. Stupid typo :(
Shame on me.

Anyway, now I can debug it in Xcode IDE again.

Stephan

Re: Advanced search glitch

2010-09-18 Thread Edwin Leuven
Pavel Sanda  wrote:
> its almost impossible to find way how to insert regular expression.
> we should perhaps put it at least into normal insert menu?

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


Re: Advanced search glitch

2010-09-18 Thread Pavel Sanda
Edwin Leuven wrote:
> Pavel Sanda  wrote:
> > its almost impossible to find way how to insert regular expression.
> > we should perhaps put it at least into normal insert menu?
> 
> http://www.lyx.org/trac/changeset/35430

thanks,
pavel


Re: #4624: Exporting to latex with included bibtex bbl

2010-09-18 Thread Pavel Sanda
Manoj Rajagopalan wrote:
> I thought'd I'd solved this and submitted a patch? No? This had involved 
> creating a new export filter ...

in such case you haven't been assertive enough to make somebody push it in.
(generally dont hesitate to draw attantion again if you feel ignored ;)

the bugzilla entry had no link so i didnt saw anything to be committed.
please repost the patch to the list if you still want it in 2.0.

pavel


Re: Bugs

2010-09-18 Thread Pavel Sanda
Pavel Sanda wrote:
> i'm just going to be little bit aggressive about the bugs in trac
> because its impossible to fullfill the whole list for 2.0.

JMarc, could you add new keyword inside trac? something like "test"
for the automatical tests from John. 

number of bugs generated by those tests is beyond our man power to fix and we
should concentrate on the real scenario issues. i'm going to kill tagrget and
priority of the test crash/assert-bugs which look to be usecases of testing
engine or non reproducible test. still i would like to have  grouped these by
some keyword...

pavel


Re: Thesaurus feature (trunk)

2010-09-18 Thread Jürgen Spitzmüller
Kornel Benko wrote:
> I very much like the thesaurus feature. But in a multilingual document
> the default language for thesaurus is always the document language, even if
> the checked word is marked in another language. One has then to explicitly
> select, which, I think,  could be improved.

This is supposed to work as you describe, and it does so here.

Jürgen


pref2pref

2010-09-18 Thread Richard Heck

On 09/18/2010 11:16 AM, rgh...@lyx.org wrote:

Author: rgheck
Date: Sat Sep 18 17:16:04 2010
New Revision: 35436
URL: http://www.lyx.org/trac/changeset/35436

Log:
Conversion for tabular-feature.

I believe this completes the LFUN conversions, at least if RELEASE_NOTES
is complete in this respect.

   
What we do not have at this point is any way to call the script from 
within LyX. I guess this should be done as we read the ui and bind files.


Can someone handle that part? When we commit that, we should also 
introduce a

 Format 1
tag into LyX 2.0's ui and bind files. (The old format is format 0.)

Richard



Re: Beta plans (again, again)

2010-09-18 Thread Abdelrazak Younes

On 17/09/2010 18:57, Pavel Sanda wrote:

Abdelrazak Younes wrote:
   

This works for me:
 

thanks, added to my local patch set ;)
   


No need to, as I have the nod of 2 devs, I just committed it.

Abdel.



Re: Thesaurus feature (trunk)

2010-09-18 Thread Kornel Benko
Am Samstag 18 September 2010 schrieb Jürgen Spitzmüller:
> Kornel Benko wrote:
> > I very much like the thesaurus feature. But in a multilingual document
> > the default language for thesaurus is always the document language, even
> > if the checked word is marked in another language. One has then to
> > explicitly select, which, I think,  could be improved.
> 
> This is supposed to work as you describe, and it does so here.
> 
> Jürgen

Yes, but this is not the point I meant.

Kornel


signature.asc
Description: This is a digitally signed message part.


Re: #6799: Spell checking word selection fails

2010-09-18 Thread James C. Sutherland
This appears to be fixed in alpha6.  Thanks to all of their developers for
their hard work on this - I look forward to using 2.0!
James


On Fri, Sep 17, 2010 at 6:36 PM, LyX Ticket Tracker  wrote:

> #6799: Spell checking word selection fails
>
> +---
>  Reporter:  james   |   Owner:  lasgouttes
> Type:  defect  |  Status:  new
>  Priority:  normal  |   Milestone:  2.0.0
> Component:  spell   | Version:  2.0.0svn
>  Severity:  normal  |Keywords:
>
> +---
>
> Comment(by sanda):
>
>  can you still see this in alpha6?
>
> --
> Ticket URL: 
> The LyX Project 
> LyX -- The Document Processor
>


Patch: Diagram inset

2010-09-18 Thread Ronen Abravanel
Hello,

I created a patch that adds a Feynman diagram inset into lyx. The inset is
based on the inst "Diagram" in the package feyn (
http://www.ctan.org/tex-archive/fonts/feyn/ ) . The inset is meant to
replace the hack described in the 3rd section of the following document:
http://www.technion.ac.il/~ronen/latex/lyx_quantum.pdf
http://www.technion.ac.il/~ronen/latex/lyx_quantum.lyx

The patch is based on 2.0 Alpha 6, and based mostly on copied code from
XYMatrix inset.

I will appreciate comments regarding the patch. Is it too late to include it
in 2.0?

Thanks,
Ronen Abravanel
diff -rupN lyx-2.0.0alpha6/src/insets/InsetCode.h lyx-2.0.0alpha6_feynFinal/src/insets/InsetCode.h
--- lyx-2.0.0alpha6/src/insets/InsetCode.h	2010-09-15 16:33:43.0 -0400
+++ lyx-2.0.0alpha6_feynFinal/src/insets/InsetCode.h	2010-09-18 12:00:16.0 -0400
@@ -223,6 +223,8 @@ enum InsetCode {
 	///
 	PREVIEW_CODE,
 	///
+	MATH_DIAGRAM_CODE, //RCHANGE
+	///
 	INSET_CODE_SIZE,
 };
 
diff -rupN lyx-2.0.0alpha6/src/insets/Inset.cpp lyx-2.0.0alpha6_feynFinal/src/insets/Inset.cpp
--- lyx-2.0.0alpha6/src/insets/Inset.cpp	2010-09-15 16:33:42.0 -0400
+++ lyx-2.0.0alpha6_feynFinal/src/insets/Inset.cpp	2010-09-18 12:00:16.0 -0400
@@ -168,6 +168,7 @@ static void build_translator()
 	insetnames[MATH_XARROW_CODE] = InsetName("mathxarrow");
 	insetnames[MATH_XYARROW_CODE] = InsetName("mathxyarrow");
 	insetnames[MATH_XYMATRIX_CODE] = InsetName("mathxymatrix");
+	insetnames[MATH_DIAGRAM_CODE] = InsetName("mathdyagram");
 	insetnames[MATH_MACRO_CODE] = InsetName("mathmacro");
 
 	passed = true;
diff -rupN lyx-2.0.0alpha6/src/LaTeXFeatures.cpp lyx-2.0.0alpha6_feynFinal/src/LaTeXFeatures.cpp
--- lyx-2.0.0alpha6/src/LaTeXFeatures.cpp	2010-09-15 16:33:41.0 -0400
+++ lyx-2.0.0alpha6_feynFinal/src/LaTeXFeatures.cpp	2010-09-18 12:00:16.0 -0400
@@ -746,6 +746,9 @@ string const LaTeXFeatures::getPackages(
 	if (mustProvide("xy"))
 		packages << "\\usepackage[all]{xy}\n";
 
+	if (mustProvide("feyn"))
+		packages << "\\usepackage{feyn}\n"; //Diagram
+
 	if (mustProvide("ulem"))
 		packages << "\\PassOptionsToPackage{normalem}{ulem}\n"
 			"\\usepackage{ulem}\n";
diff -rupN lyx-2.0.0alpha6/src/lyxmathed.cpp lyx-2.0.0alpha6_feynFinal/src/lyxmathed.cpp
--- lyx-2.0.0alpha6/src/lyxmathed.cpp	2010-09-16 04:26:35.0 -0400
+++ lyx-2.0.0alpha6_feynFinal/src/lyxmathed.cpp	2010-09-18 12:00:16.0 -0400
@@ -52,6 +52,7 @@
 #include "mathed/InsetMathUnknown.cpp" 
 #include "mathed/InsetMathXArrow.cpp" 
 #include "mathed/InsetMathXYMatrix.cpp" 
+#include "mathed/InsetMathDiagram.cpp"
 #include "mathed/MathAtom.cpp" 
 #include "mathed/MathAutoCorrect.cpp" 
 #include "mathed/MathData.cpp" 
diff -rupN lyx-2.0.0alpha6/src/Makefile.am lyx-2.0.0alpha6_feynFinal/src/Makefile.am
--- lyx-2.0.0alpha6/src/Makefile.am	2010-09-15 16:33:42.0 -0400
+++ lyx-2.0.0alpha6_feynFinal/src/Makefile.am	2010-09-18 12:00:16.0 -0400
@@ -409,6 +409,7 @@ SOURCEFILESMATHED = \
 	mathed/InsetMathUnknown.cpp \
 	mathed/InsetMathXArrow.cpp \
 	mathed/InsetMathXYMatrix.cpp \
+	mathed/InsetMathDiagram.cpp \
 	mathed/MathAtom.cpp \
 	mathed/MathAutoCorrect.cpp \
 	mathed/MathData.cpp \
@@ -474,6 +475,7 @@ HEADERFILESMATHED = \
 	mathed/InsetMathUnknown.h \
 	mathed/InsetMathXArrow.h \
 	mathed/InsetMathXYMatrix.h \
+	mathed/InsetMathDiagram.h \
 	mathed/MathAtom.h \
 	mathed/MathAutoCorrect.h \
 	mathed/MathData.h \
diff -rupN lyx-2.0.0alpha6/src/mathed/InsetMathDiagram.cpp lyx-2.0.0alpha6_feynFinal/src/mathed/InsetMathDiagram.cpp
--- lyx-2.0.0alpha6/src/mathed/InsetMathDiagram.cpp	1969-12-31 19:00:00.0 -0500
+++ lyx-2.0.0alpha6_feynFinal/src/mathed/InsetMathDiagram.cpp	2010-09-18 12:00:16.0 -0400
@@ -0,0 +1,143 @@
+/**
+ * \file InsetMathDiagram.cpp
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz, Ronen Abravanel
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include 
+
+#include "InsetMathDiagram.h"
+
+#include "LaTeXFeatures.h"
+#include "MathStream.h"
+
+#include 
+
+namespace lyx {
+
+
+InsetMathDiagram::InsetMathDiagram(Buffer * buf, Length const & s, char c,
+	bool e) : InsetMathGrid(buf, 1, 1), spacing_(s), spacing_code_(c),
+	equal_spacing_(e)
+{
+}
+
+
+Inset * InsetMathDiagram::clone() const
+{
+	return new InsetMathDiagram(*this);
+}
+
+
+int InsetMathDiagram::colsep() const
+{
+	return 10;
+}
+
+
+int InsetMathDiagram::rowsep() const
+{
+	return 10;
+}
+
+
+void InsetMathDiagram::metrics(MetricsInfo & mi, Dimension & dim) const
+{
+	if (mi.base.style == LM_ST_DISPLAY)
+		mi.base.style = LM_ST_TEXT;
+	InsetMathGrid::metrics(mi, dim);
+}
+
+
+void InsetMathDiagram::write(WriteStream & os) const
+{
+	MathEnsurer ensurer(os);
+	os << "\\Diagram";
+	if (equal_spacing_) {
+		os << "@!";
+		switch (spacing_code_) {
+		case '0':
+		case 'R':
+		case 'C':
+			os << spacing_code_;
+		}
+	} else {
+		s

Re: Solving the Meta/Control key swap problem on Mac OS X

2010-09-18 Thread Jens Nöckel

On Sep 17, 2010, at 3:48 PM, Pavel Sanda wrote:

> Stephan Witt wrote:
>>> So if I put Pavel's suggestion in, would my checkbox patch be acceptable? 
>>> As I said, I'd be OK without GUI, but I don't really think it will hurt 
>>> anyone to have it in there, with the default being not to change the key 
>>> mapping.
>> 
>> I'd have no problem with that.
> 
> +1

OK, here is the new patch for the current LyX 2.0 in svn trunk:


modifierKey-2.diff
Description: Binary data


The check box is added in Preferences > Editing > Keyboard/Mouse, but only if 
we're on MacOSX with Qt > 4.6.0. The default setting is to leave everything as 
it is now. When the check box is set, the Mac control key will act as LyX Ctrl 
and the Mac Command key will act as LyX Meta (which is the reverse of the 
current default mapping, and is preferred by emacs users). No matter what the 
setting is, the MacOSX-specific commands for "Quit", "Hide" and "Preferences" 
will be unchanged (i.e., they continue to use the Mac Command key).

Thanks,
Jens



Re: Solving the Meta/Control key swap problem on Mac OS X

2010-09-18 Thread Jens Nöckel

On Sep 18, 2010, at 10:14 AM, Jens Nöckel wrote:

> 
> On Sep 17, 2010, at 3:48 PM, Pavel Sanda wrote:
> 
>> Stephan Witt wrote:
 So if I put Pavel's suggestion in, would my checkbox patch be acceptable? 
 As I said, I'd be OK without GUI, but I don't really think it will hurt 
 anyone to have it in there, with the default being not to change the key 
 mapping.
>>> 
>>> I'd have no problem with that.
>> 
>> +1
> 
> OK, here is the new patch for the current LyX 2.0 in svn trunk:
> 
> 
> The check box is added in Preferences > Editing > Keyboard/Mouse, but only if 
> we're on MacOSX with Qt > 4.6.0. The default setting is to leave everything 
> as it is now. When the check box is set, the Mac control key will act as LyX 
> Ctrl and the Mac Command key will act as LyX Meta (which is the reverse of 
> the current default mapping, and is preferred by emacs users). No matter what 
> the setting is, the MacOSX-specific commands for "Quit", "Hide" and 
> "Preferences" will be unchanged (i.e., they continue to use the Mac Command 
> key).

Another comment I forgot to add (but had mentioned earlier): the change takes 
effect only after restarting LyX (because the keynoard shortcuts in the menu 
bar have to be rebuilt).

Jens



Re: Bugs

2010-09-18 Thread John McCabe-Dansted
On Sat, Sep 18, 2010 at 7:57 PM, Pavel Sanda  wrote:
> Pavel Sanda wrote:
>> i'm just going to be little bit aggressive about the bugs in trac
>> because its impossible to fullfill the whole list for 2.0.
>
> JMarc, could you add new keyword inside trac? something like "test"
> for the automatical tests from John.
>
> number of bugs generated by those tests is beyond our man power to fix and we
> should concentrate on the real scenario issues. i'm going to kill tagrget and
> priority of the test crash/assert-bugs which look to be usecases of testing
> engine or non reproducible test. still i would like to have  grouped these by
> some keyword...

We can at least easily find these bugs:
http://www.lyx.org/trac/search?q=keytest

Also, I agree that the priority of keytest bugs should be lower than
those bugs that are known to have already affected a human user. I was
a little surprised that they were mostly marked Critical.

I presume I should continue to report these bugs and let you triage them?

-- 
John C. McCabe-Dansted


Re: Solving the Meta/Control key swap problem on Mac OS X

2010-09-18 Thread Pavel Sanda
> OK, here is the new patch for the current LyX 2.0 in svn trunk:

please note that its difficult to directly comment on your pacthes, because the
attachment is signed as octet-stream type. one need for examples 
application/text
(maybe only naming the attachment .patch would help, depends on your mailer...)

some comments:

>   this, SIGNAL(changed()));
>   connect(scrollzoomValueCO, SIGNAL(activated(int)),
>   this, SIGNAL(changed()));
> +
> +// GUI_DONTSWAPCB_VISIBLE reveals checkbox for switching Ctrl and Meta on 
> Mac: 
> +#ifdef Q_WS_MACX
> +#if QT_VERSION > 0x040600
> + connect(dontswapCB, SIGNAL(toggled(bool)),
> + this, SIGNAL(changed()));

i would be happy if we can get rid of any additional #ifdefs. it needs to be 
tested
but i guess except this part:

> + dontswapCB->setVisible(false);

all other parts of code could be normally written and no GUI_DONTSWAPCB_VISIBLE 
needed.

> + Do not swap Meta and Control keys

add something like "on MacOSX"...

>  void LyXRC::setDefaults()
>  {
> + mac_dontswap_ctrl_meta = false;

concerning the default value - this is the current value lyx uses or are we 
changing defaults?
also put this assignment more down between other rc settings concerning 
keyboard.

other parts looks fine. (dow we have already GPL statement from you?)

pavel


Re: Bugs

2010-09-18 Thread Pavel Sanda
John McCabe-Dansted wrote:
> Also, I agree that the priority of keytest bugs should be lower than
> those bugs that are known to have already affected a human user. I was
> a little surprised that they were mostly marked Critical.

we had policy that any crash/assert should be critical, but this intuition
grew in the world of human testing. we have to change this policy according
to the new world order :)

> I presume I should continue to report these bugs and let you triage them?

yes.
pavel


Re: pref2pref

2010-09-18 Thread Pavel Sanda
Richard Heck wrote:
> What we do not have at this point is any way to call the script from within 
> LyX. I guess this should be done as we read the ui and bind files.

i wonder whether lyx shouldnt ask before before the conversion takes place.
it happened to me many times that i run devel version against branch settings
by accident

pavel


Re: Patch: Diagram inset

2010-09-18 Thread Pavel Sanda
Ronen Abravanel wrote:
> Hello,
> 
> I created a patch that adds a Feynman diagram inset into lyx. The inset is
> based on the inst "Diagram" in the package feyn (
> http://www.ctan.org/tex-archive/fonts/feyn/ ) . The inset is meant to
> replace the hack described in the 3rd section of the following document:
> http://www.technion.ac.il/~ronen/latex/lyx_quantum.pdf
> http://www.technion.ac.il/~ronen/latex/lyx_quantum.lyx
> 
> The patch is based on 2.0 Alpha 6, and based mostly on copied code from
> XYMatrix inset.
> 
> I will appreciate comments regarding the patch. Is it too late to include it
> in 2.0?

hi, as i have already written in our private exchange this still can go in.

the nice thing - its basically copy of another inset so i dont expect it to
import many new bugs ;) from this follows one comment though - can you please
try to make InsetMathDiagram to be descendant from the insetxymatrix class so
only the new method which have different code are written in your
InsetMathDiagram.h/cpp files?

also it would be good to test it before commiting, so if you can provide some 
example file...

few more comments:

> diff -rupN lyx-2.0.0alpha6/src/insets/InsetCode.h 
> lyx-2.0.0alpha6_feynFinal/src/insets/InsetCode.h
> --- lyx-2.0.0alpha6/src/insets/InsetCode.h2010-09-15 16:33:43.0 
> -0400
> +++ lyx-2.0.0alpha6_feynFinal/src/insets/InsetCode.h  2010-09-18 
> 12:00:16.0 -0400
> @@ -223,6 +223,8 @@ enum InsetCode {
>   ///
>   PREVIEW_CODE,
>   ///
> + MATH_DIAGRAM_CODE, //RCHANGE

kill comment

> + insetnames[MATH_DIAGRAM_CODE] = InsetName("mathdyagram");

"y" typo?

> --- lyx-2.0.0alpha6/src/lyxmathed.cpp 2010-09-16 04:26:35.0 -0400
> +++ lyx-2.0.0alpha6_feynFinal/src/lyxmathed.cpp   2010-09-18 
> 12:00:16.0 -0400
> @@ -52,6 +52,7 @@
>  #include "mathed/InsetMathUnknown.cpp" 
>  #include "mathed/InsetMathXArrow.cpp" 
>  #include "mathed/InsetMathXYMatrix.cpp" 
> +#include "mathed/InsetMathDiagram.cpp"
>  #include "mathed/MathAtom.cpp" 
>  #include "mathed/MathAutoCorrect.cpp" 
>  #include "mathed/MathData.cpp" 

this file is generated, no need for patch... if you work under svn, not
under the tarball, "svn diff" will report exactly those files which belongs
to the tree and are not automatically generated... 
(http://www.lyx.org/HowToUseSVN)


> + * \file InsetMathDiagram.cpp
> + * This file is part of LyX, the document processor.
> + * Licence details can be found in the file COPYING.
> + *
> + * \author André Pönitz, Ronen Abravanel

two lines

> diff -rupN lyx-2.0.0alpha6/src/mathed/MathFactory.cpp 
> lyx-2.0.0alpha6_feynFinal/src/mathed/MathFactory.cpp
> --- lyx-2.0.0alpha6/src/mathed/MathFactory.cpp2010-09-15 
> 16:33:43.0 -0400
> +++ lyx-2.0.0alpha6_feynFinal/src/mathed/MathFactory.cpp  2010-09-18 
> 12:19:44.0 -0400
> @@ -44,6 +44,7 @@
>  #include "InsetMathHull.h"
>  #include "InsetMathXArrow.h"
>  #include "InsetMathXYMatrix.h"
> +#include "InsetMathDiagram.h"
>  #include "MacroTable.h"
>  #include "MathMacro.h"
>  #include "MathMacroArgument.h"
> @@ -417,6 +418,48 @@ MathAtom createInsetMath(docstring const
>   return MathAtom(new InsetMathXYMatrix(buf, spacing, 
> spacing_code,
>   equal_spacing));
>   }
> +
> + if (s.substr(0, 8) == "Diagram") {
> + char spacing_code = '\0';
> + Length spacing;
> + bool equal_spacing = false;
> + size_t const len = s.length();
> + size_t i = 8;
> + if (i < len && s[i] == '@') {
> + ++i;
> + if (i < len && s[i] == '!') {
> + equal_spacing = true;
> + ++i;
> + if (i < len) {
> + switch (s[i]) {
> + case '0':
> + case 'R':
> + case 'C':
> + spacing_code = 
> static_cast(s[i]);
> + }
> + }
> + } else if (i < len) {
> + switch (s[i]) {
> + case 'R':
> + case 'C':
> + case 'M':
> + case 'W':
> + case 'H':
> + case 'L':
> + spacing_code = static_cast(s[i]);
> + ++i;
> + break;
> + }
> + if (i < len && s[i] == '=') {
> + ++i;
> + spacing = Length(to_ascii(s.substr(i)));
> + }
> + }
> + }
> + 

Re: pref2pref

2010-09-18 Thread Richard Heck

On 09/18/2010 03:55 PM, Pavel Sanda wrote:

Richard Heck wrote:
   

What we do not have at this point is any way to call the script from within
LyX. I guess this should be done as we read the ui and bind files.
 

i wonder whether lyx shouldnt ask before before the conversion takes place.
it happened to me many times that i run devel version against branch settings
by accident

   
I'm assuming that, as with layouts, LyX should only convert the file 
"internally", leaving the original file as is. Unless, of course, you 
then make some modification (to shortcuts, say, or to preferences). Then 
LyX will have to write the file in the format of whatever version you 
are using. But this is already true.


As with layout2layout, again, I don't see a need to provide for 
reversion. OK?


Richard



Re: Patch: Diagram inset

2010-09-18 Thread Richard Heck

On 09/18/2010 04:48 PM, Pavel Sanda wrote:

also this is fileformat change - that is .lyx files generated with this patch 
cannot
be correctly read by older version of lyx and we need to handle that. it should 
be simple here -
either only bump file version or we just need that when file is converted to lyx 1.6 
"\use_package{feyn}"
is put into the preamble so its compilable even in 1.6. look on the beginning 
of this commit:
http://www.lyx.org/trac/changeset/34748
to have idea how we handle bumping new fileformat versions.

(the code of diagram math inset should be readable even in older version of lyx 
because we store
all math insets as pure tex construct...)

   
I guess the point is that the math diagram stuff will simply be imported 
into 1.6.x as Math ERT, i.e., InsetMathUnknown, right? If so, then you 
are right that the only thing that needs doing is to add 
\use_package{feyn} when the math diagram stuff is encountered, not always.


I don't know if you do python Ronen, so I've attached the lyx2lyx stuff. 
Bump the format in Buffer.cpp to 401 and you're done. Untested, though, 
so please check that export to 1.6.x works as it should (i.e., that 
\use_package{feyn} gets added to the preamble).


One other thing: inheriting from InsetXYMatrix will pull in the 
htmlize() and mathmlize() functions, which you omitted. They should be 
the same here. So that's another reason to do it that way. Or maybe 
there should be some common virtual class from which they both inherit, 
since neither is really basic.


And thanks for the contribution. Hope there will be more!

Richard

Index: lyx_2_0.py
===
--- lyx_2_0.py  (revision 35436)
+++ lyx_2_0.py  (working copy)
@@ -2162,6 +2162,22 @@
 return
 
 
+def revert_diagram(document):
+  i = 0
+  re_diagram = re.compile(r'\\begin_inset Formula .*\\Diagram')
+  while True:
+i = find_token(document.body, '\\begin_inset Formula', i)
+if i == -1:
+  return
+m = re_diagram.search(document.body[i])
+if not m:
+  i += 1
+  continue
+add_to_preamble(document, "\\use_package{feyn}")
+# only need to do it once!
+return
+
+
 ##
 # Conversion hub
 #
@@ -2221,10 +2237,12 @@
[397, [remove_Nameref]],
[398, []],
[399, [convert_mathdots]],
-   [400, [convert_rule]]
+   [400, [convert_rule]],
+   [401, []]
   ]
 
-revert =  [[399, [revert_rule]],
+revert =  [[400, [revert_diagram]],
+   [399, [revert_rule]],
[398, [revert_mathdots]],
[397, [revert_mathrsfs]],
[396, []],


Re: Solving the Meta/Control key swap problem on Mac OS X

2010-09-18 Thread Jens Nöckel
Another version of the patch is attached, this time hopefully readable by everyone... There was one additional line in GuiApplication.cpp that I took out - it was commented out anyway and corresponded to the initial test I described in http://wiki.lyx.org/Mac/LyXmodifierKeys#sMac.LyXmodifierKeys_5 (which is no longer the way I do things). It was put in by Stephan in rev. 34812.  

modifierKey-3.patch
Description: Binary data
Below are some more responses:On Sep 18, 2010, at 12:48 PM, Pavel Sanda wrote:i would be happy if we can get rid of any additional #ifdefs. it needs to be testedbut i guess except this part:+	dontswapCB->setVisible(false);all other parts of code could be normally written and no GUI_DONTSWAPCB_VISIBLE needed.I took those two #ifdef out.+ Do not swap Meta and Control keysadd something like "on MacOSX"...Since this text only shows up on Mac anyway, I just modified the text slightly and added your suggestion in a tooltip instead. void LyXRC::setDefaults() {+	mac_dontswap_ctrl_meta = false;concerning the default value - this is the current value lyx uses or are we changing defaults?also put this assignment more down between other rc settings concerning keyboard.Yes, the default _is_ to swap Apple and Ctrl keys. That's what makes this so annoying to emacs users. And by _not_ swapping these modifier keys we are changing the default. The check box unchecked when the default setting is desired. Basically I'm following the nomenclature as dictated by Qt's convoluted Mac behavior (their Attribute  "MacDontSwapCtrlAndMeta" is false by default)...   other parts looks fine. (dow we have already GPL statement from you?)Probably not - I'll send it in the next message.Jens

GPL statement

2010-09-18 Thread Jens Nöckel
Hi again,
sorry that my patch still appears to be encoded wrong... it opens fine for me 
but I'll see how I can change mime type next time. Anyway, here is the 
statement:

I hereby grant permission to license my contributions to LyX under the Gnu 
General Public Licence, version 2 or later.

Jens


 

Re: Please, verify the INSTALL on MacOSX document...

2010-09-18 Thread BH
On Mon, Sep 6, 2010 at 7:56 AM, Stephan Witt  wrote:
> Am 06.09.2010 um 13:46 schrieb BH:
>
>> On Mon, Sep 6, 2010 at 7:21 AM, Stephan Witt  wrote:
>>> I've prepared an updated version of INSTALL.MacOSX.
>>>
>>> If possible, I'd like to get it verified by other people with mac hardware 
>>> before I commit it.
>>
>> I'll take a look, though it might be a while
>
> Thanks, I'll wait a while... :-)

And now it's been a while.

I tried this out with a new Mac, and it works well. I did not compile
aspell or test Tiger or 64-bit support.

A couple of minor comments, with my numbering following that of INSTALL.MacOSX:

PREREQUISITES

1. Can Qt be installed from Nokia's .dmg, or must it be self-compiled?
I followed the instructions to compile it myself, and it worked with
no problems, but if that's not necessary, it might be worth making it
clearer.

2. The version of automake macports installed is 2.67, which
autogen.sh rejected. (It wants only automake < 2.65.) So I had to edit
autogen.sh to allow 2.67, which worked fine.

BUILD INSTRUCTIONS

1. Environment

(a) ... "We have to change that with if on that build system". Should
this be: "We have to change that if not on that build system"?



That's it. Nice job with the clear documentation ... and nice work on
LyX/Mac quite generally. It's coming along great!

BH


Re: Patch: Diagram inset

2010-09-18 Thread Ronen Abravanel
Thanks,

Richard -- The python code you sent me did not done the job. I fixed it.

Pavel -- Thanks. I removed big portion of the code that was not needed.
But now, both classes are little more different.

I can refactor both XYMatrix and Diagram class to have one common base
class, but it will take me a while. How urgent things should be ready for
2.0?

Patch and Example file attached, and anyway:

I hereby grant permission to license my contributions to LyX under the Gnu
General Public Licence, version 2 or later.

On Sat, Sep 18, 2010 at 6:33 PM, Richard Heck  wrote:

> On 09/18/2010 04:48 PM, Pavel Sanda wrote:
>
>> also this is fileformat change - that is .lyx files generated with this
>> patch cannot
>> be correctly read by older version of lyx and we need to handle that. it
>> should be simple here -
>> either only bump file version or we just need that when file is converted
>> to lyx 1.6 "\use_package{feyn}"
>> is put into the preamble so its compilable even in 1.6. look on the
>> beginning of this commit:
>> http://www.lyx.org/trac/changeset/34748
>> to have idea how we handle bumping new fileformat versions.
>>
>> (the code of diagram math inset should be readable even in older version
>> of lyx because we store
>> all math insets as pure tex construct...)
>>
>>
>>
> I guess the point is that the math diagram stuff will simply be imported
> into 1.6.x as Math ERT, i.e., InsetMathUnknown, right? If so, then you are
> right that the only thing that needs doing is to add \use_package{feyn} when
> the math diagram stuff is encountered, not always.
>
> I don't know if you do python Ronen, so I've attached the lyx2lyx stuff.
> Bump the format in Buffer.cpp to 401 and you're done. Untested, though, so
> please check that export to 1.6.x works as it should (i.e., that
> \use_package{feyn} gets added to the preamble).
>
> One other thing: inheriting from InsetXYMatrix will pull in the htmlize()
> and mathmlize() functions, which you omitted. They should be the same here.
> So that's another reason to do it that way. Or maybe there should be some
> common virtual class from which they both inherit, since neither is really
> basic.
>
> And thanks for the contribution. Hope there will be more!
>
> Richard
>
>
diff -rupN lyx-2.0.0alpha6/lib/lyx2lyx/lyx_2_0.py lyx-2.0.0alpha6_feynFinal/lib/lyx2lyx/lyx_2_0.py
--- lyx-2.0.0alpha6/lib/lyx2lyx/lyx_2_0.py	2010-09-15 16:33:40.0 -0400
+++ lyx-2.0.0alpha6_feynFinal/lib/lyx2lyx/lyx_2_0.py	2010-09-18 23:38:50.0 -0400
@@ -2161,6 +2160,27 @@ def revert_rule(document):
   else:
 return
 
+def revert_diagram(document):
+  i = 0
+  re_diagram = re.compile(r'\\begin_inset Formula .*\\Diagram', re.DOTALL)
+  while True:
+i = find_token(document.body, '\\begin_inset Formula', i)
+if i == -1:
+  print "returning"
+  return
+j = find_end_of_inset(document.body, i)
+if j == -1:
+print "Melformed document!"
+return 
+m = re_diagram.search("\n".join(document.body[i:j]))
+if not m:
+  i += 1
+  continue
+add_to_preamble(document, "\\use_package{feyn}")
+# only need to do it once!
+return
+
+
 
 ##
 # Conversion hub
@@ -2221,10 +2241,12 @@ convert = [[346, []],
[397, [remove_Nameref]],
[398, []],
[399, [convert_mathdots]],
-   [400, [convert_rule]]
+   [400, [convert_rule]],
+   [401, []]
   ]
 
-revert =  [[399, [revert_rule]],
+revert =  [[400, [revert_diagram]],
+   [399, [revert_rule]],
[398, [revert_mathdots]],
[397, [revert_mathrsfs]],
[396, []],
diff -rupN lyx-2.0.0alpha6/src/Buffer.cpp lyx-2.0.0alpha6_feynFinal/src/Buffer.cpp
--- lyx-2.0.0alpha6/src/Buffer.cpp	2010-09-15 16:33:41.0 -0400
+++ lyx-2.0.0alpha6_feynFinal/src/Buffer.cpp	2010-09-18 22:33:25.0 -0400
@@ -127,7 +127,7 @@ namespace {
 
 // Do not remove the comment below, so we get merge conflict in
 // independent branches. Instead add your own.
-int const LYX_FORMAT = 400; // uwestoehr: support for \rule
+int const LYX_FORMAT = 401; // uwestoehr: support for \rule \\Ronen: support for \Diagrasr
 
 typedef map DepClean;
 typedef map > RefCache;
diff -rupN lyx-2.0.0alpha6/src/insets/InsetCode.h lyx-2.0.0alpha6_feynFinal/src/insets/InsetCode.h
--- lyx-2.0.0alpha6/src/insets/InsetCode.h	2010-09-15 16:33:43.0 -0400
+++ lyx-2.0.0alpha6_feynFinal/src/insets/InsetCode.h	2010-09-18 21:22:40.0 -0400
@@ -223,6 +223,8 @@ enum InsetCode {
 	///
 	PREVIEW_CODE,
 	///
+	MATH_DIAGRAM_CODE, 
+	///
 	INSET_CODE_SIZE,
 };
 
diff -rupN lyx-2.0.0alpha6/src/insets/Inset.cpp lyx-2.0.0alpha6_feynFinal/src/insets/Inset.cpp
--- lyx-2.0.0alpha6/src/insets/Inset.cpp	2010-09-15 16:33:42.0 -0400
+++ lyx-2.0.0alpha6_feynFinal/src/insets/Inset.cpp	2010-09-18 21:23:37.0 -0400
@@ -168,6 +168,7 @@ static void build_translator()
 	insetnames[MATH_XARROW_CODE] = InsetName("mathxarrow");
 	insetnames[MAT

When preview is on

2010-09-18 Thread Ronen Abravanel
Currently, in Lyx 2.0, there are 3 modes for preview:
* On -- Preview is working for math and preview-inset
* No math --
* Off

My 1st question is what the different between "no math" and Off? what else
is previewed other than math and preview inset?

My second concern is the reason this mail is on the developers list: Is
there any reason no to separate the rendering of the preview-inset from
regular math? for 98 percent of my math -- I prefer it will not be rendered.
But for the other two percent -- the diagrams (either using \xymatrix, the
new \Diagram inset, or just plain-old ERT), I would really like to be
previewed.

If it's some arbitrary decision, and you didn't thought it's important, I'll
be happy to try and do the change.. (although i'll be happy for some
pointers, as I don't yet very familiar with lyx' code).


Ronen.


Re: Please, verify the INSTALL on MacOSX document...

2010-09-18 Thread Jens Nöckel

On Sep 18, 2010, at 6:33 PM, BH wrote:
> 
> That's it. Nice job with the clear documentation ... and nice work on
> LyX/Mac quite generally. It's coming along great!

Hi Bennett,
I agree the INSTALL.MacOSX is now much more comprehensive and useful!
I had to make some adjustments though, because I compiled on a machine where I 
use fink instead of MacPorts (our newest Mac uses MacPorts, but I'm not 
compiling LyX on that one... just to make life more interesting). 
So in my case, here is a summary of the steps, assuming you have autoconf, 
gettext and pkgconfig from fink:

1)
Compile qt-everywhere-opensource-src-4.6.3 (universal without Tiger) as in step 
1 of INSTALL.MacOSX. The download location for the source is 
ftp://ftp.qt.nokia.com/qt/source/ (which may be a little hard to find if you're 
following the link given in INSTALL.MacOSX)

2)
Then to build LyX from SVN, download the source using 
svn co svn://svn.lyx.org/lyx/lyx-devel/trunk lyx-devel

Set I the following flags (assuming bash syntax): 
export CFLAGS="-arch i386"
export CXXFLAGS="-arch i386"
export OBJCFLAGS="-arch i386"
export LDFLAGS="-framework Carbon -framework AppKit -arch i386" 
This differs from INSTALL.MacOSX because my version of pkgconfig wasn't clever 
enough to detect the framework dependencies automatically.

Next, in the lyx-devel directory, I did:
./autogen.sh
./configure --with-version-suffix=-2.0 --disable-stdlib-debug 
--prefix=PATH/TO/LyX.app --with-qt4-dir=/path/to/QT4 --with-libiconv-prefix=/usr
make
make install-strip

The libiconv prefix needed to be specified on the configure line to avoid 
loading an older version of that library installed by fink. 

That's how things worked for me.

Best,
Jens