Re: Can't create a macro with 2.4.0~devel

2024-02-28 Thread Jean-Marc Lasgouttes

Le 28/02/2024 à 13:01, JP a écrit :




Le 28 février 2024 12:03:58 Jean-Marc Lasgouttes  a 
écrit :



Le 28/02/2024 à 11:51, Jean-Pierre Chrétien a écrit :

Le 27/02/2024 à 07:51, Jean-Marc Lasgouttes a écrit :

Indeed, insetAllowed forbids it for some reason. However the insertion
is not guarded correctly. I do not want to fix this now, I have first
to fix the crash


The copy works and the crash is gone. Thanks!


Hmm, what copy works?


 From English Math.lyx to French Math.lyx.


OK, thanks.

JMarc

--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Can't create a macro with 2.4.0~devel

2024-02-28 Thread JP




Le 28 février 2024 12:03:58 Jean-Marc Lasgouttes  a écrit :


Le 28/02/2024 à 11:51, Jean-Pierre Chrétien a écrit :

Le 27/02/2024 à 07:51, Jean-Marc Lasgouttes a écrit :

Indeed, insetAllowed forbids it for some reason. However the insertion
is not guarded correctly. I do not want to fix this now, I have first
to fix the crash


The copy works and the crash is gone. Thanks!


Hmm, what copy works?



From English Math.lyx to French Math.lyx.


--
Jean-Pierre

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Can't create a macro with 2.4.0~devel

2024-02-28 Thread Jean-Marc Lasgouttes

Le 27/02/2024 à 18:48, Richard Kimberly Heck a écrit :
I can't imagine why one would actually want to do this. Maybe it was too 
complicated to figure out the macro scope?


Let's keep it like that.

JMarc

--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Can't create a macro with 2.4.0~devel

2024-02-28 Thread Jean-Marc Lasgouttes

Le 28/02/2024 à 11:51, Jean-Pierre Chrétien a écrit :

Le 27/02/2024 à 07:51, Jean-Marc Lasgouttes a écrit :
Indeed, insetAllowed forbids it for some reason. However the insertion 
is not guarded correctly. I do not want to fix this now, I have first 
to fix the crash


The copy works and the crash is gone. Thanks!


Hmm, what copy works?

JMarc

--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Can't create a macro with 2.4.0~devel

2024-02-28 Thread Jean-Pierre Chrétien

Le 27/02/2024 à 07:51, Jean-Marc Lasgouttes a écrit :

Indeed, insetAllowed forbids it for some reason. However the insertion is not 
guarded correctly. I do not want to fix this now, I have first to fix the crash


The copy works and the crash is gone. Thanks!

--
Jean-Pierre


--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Can't create a macro with 2.4.0~devel

2024-02-27 Thread Richard Kimberly Heck

On 2/27/24 12:34, Jean-Marc Lasgouttes wrote:

Le 27/02/2024 à 14:46, Jean-Marc Lasgouttes a écrit :

Le 26/02/2024 à 17:44, Jean-Pierre Chrétien a écrit :

Le 26/02/2024 à 16:14, Jean-Marc Lasgouttes a écrit :



Now I have to understand why it crashes.


I tried in a fresh lyx file with a single table. LyX crashes with 
the same trace as the one I posted previously, I guess that you can 
reproduce.




Indeed, I see the crash too. But it is still mysterious.


I finally fixed it. The inset was not inserted (because it is actually 
not allowed) but LyX still tried to put the cursor inside this new inset.


Question is now: why is inserting a macro definition in a table cell 
forbidden? Archaeology research shows that it was inserted by Stefan 
Schimanski in the commit below, but I see no reason for it.


I can't imagine why one would actually want to do this. Maybe it was too 
complicated to figure out the macro scope?


Riki


--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Can't create a macro with 2.4.0~devel

2024-02-27 Thread Jean-Marc Lasgouttes

Le 27/02/2024 à 14:46, Jean-Marc Lasgouttes a écrit :

Le 26/02/2024 à 17:44, Jean-Pierre Chrétien a écrit :

Le 26/02/2024 à 16:14, Jean-Marc Lasgouttes a écrit :



Now I have to understand why it crashes.


I tried in a fresh lyx file with a single table. LyX crashes with the 
same trace as the one I posted previously, I guess that you can 
reproduce.




Indeed, I see the crash too. But it is still mysterious.


I finally fixed it. The inset was not inserted (because it is actually 
not allowed) but LyX still tried to put the cursor inside this new inset.


Question is now: why is inserting a macro definition in a table cell 
forbidden? Archaeology research shows that it was inserted by Stefan 
Schimanski in the commit below, but I see no reason for it.


JMarc


commit 36dbec45069bf3d9db923200835e44f44d904eb8
Author: Stefan Schimanski 
Date:   Fri Dec 21 20:42:46 2007 +

* Lazy MathData to avoid unneeded interpretation of macro definitions
* DocIterator as MacroPosition
* Iterative search for macro in scope until a visible one is found.
This include the ability to resolve macro inside nested text insets.
* Speed up macro lookups by factor 2: only getMacro(name) call, no
further hasMacro(name) call before
* Both way child/master support
* Correct macro scope for multi-paragraph environments
* Correct macro scope for multi-depth-paragraphs
* Buffer::updateMacros made const
* Update macros when loaded (of master and child)
* Do not remove too many braces when unfolding a macro. This could
lead to a data loss because the relationship between arguments of
macros can be mixed up if nested macros are unfold at once.
* Reduce dependencies to MetricsInfo in MathMacro
* Update macros when needed. Normally it's done just before doing
metrics. But in cases without a brace around some constructs (like
\left(bla\right)) there is some help needed.




--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Can't create a macro with 2.4.0~devel

2024-02-27 Thread Jean-Marc Lasgouttes

Le 26/02/2024 à 17:44, Jean-Pierre Chrétien a écrit :

Le 26/02/2024 à 16:14, Jean-Marc Lasgouttes a écrit :



Now I have to understand why it crashes.


I tried in a fresh lyx file with a single table. LyX crashes with the 
same trace as the one I posted previously, I guess that you can reproduce.




Indeed, I see the crash too. But it is still mysterious.

Fun fact: we have an inset with code MATH_MACRO_CODE and another with 
code MATHMACRO_CODE. Both have name "mathmacro".


Guess which is which?

Adding this to the endless list of thing to clean-up "later"...

JMarc
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Can't create a macro with 2.4.0~devel

2024-02-27 Thread Jean-Pierre Chrétien

Le 27/02/2024 à 07:18, Jürgen Spitzmüller a écrit :

Am Montag, dem 26.02.2024 um 17:44 +0100 schrieb Jean-Pierre Chrétien:

Le 26/02/2024 à 16:14, Jean-Marc Lasgouttes a écrit :



Now I have to understand why it crashes.


I tried in a fresh lyx file with a single table. LyX crashes with the
same trace
as the one I posted previously, I guess that you can reproduce.


Interestingly, I cannot paste macro definitions into tables. If I try
to paste the inset from 22.3 of Mathed (\Godelnum), nothing is pasted
and LyX does not crash.



Sure, I noticed that when I tried to paste the macro from English Math.lyx to 
French one. Crash happened then when I tried to create the macro.


--
Jean-Pierre


--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Can't create a macro with 2.4.0~devel

2024-02-26 Thread Jean-Marc Lasgouttes
Indeed, insetAllowed forbids it for some reason. However the insertion is not 
guarded correctly. I do not want to fix this now, I have first to fix the crash 

JMarc 

Le 27 février 2024 07:18:20 GMT+01:00, "Jürgen Spitzmüller"  
a écrit :
>Am Montag, dem 26.02.2024 um 17:44 +0100 schrieb Jean-Pierre Chrétien:
>Interestingly, I cannot paste macro definitions into tables. If I try
>to paste the inset from 22.3 of Mathed (\Godelnum), nothing is pasted
>and LyX does not crash.
>
>> 
>> -- 
>> Jean-Pierre
>> 
>> 
>
>-- 
>Jürgen
>-- 
>lyx-devel mailing list
>lyx-devel@lists.lyx.org
>http://lists.lyx.org/mailman/listinfo/lyx-devel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Can't create a macro with 2.4.0~devel

2024-02-26 Thread Jürgen Spitzmüller
Am Montag, dem 26.02.2024 um 17:44 +0100 schrieb Jean-Pierre Chrétien:
> Le 26/02/2024 à 16:14, Jean-Marc Lasgouttes a écrit :
> 
> > 
> > Now I have to understand why it crashes.
> 
> I tried in a fresh lyx file with a single table. LyX crashes with the
> same trace 
> as the one I posted previously, I guess that you can reproduce.

Interestingly, I cannot paste macro definitions into tables. If I try
to paste the inset from 22.3 of Mathed (\Godelnum), nothing is pasted
and LyX does not crash.

> 
> -- 
> Jean-Pierre
> 
> 

-- 
Jürgen
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Can't create a macro with 2.4.0~devel

2024-02-26 Thread Jean-Pierre Chrétien

Le 26/02/2024 à 16:14, Jean-Marc Lasgouttes a écrit :



Now I have to understand why it crashes.


I tried in a fresh lyx file with a single table. LyX crashes with the same trace 
as the one I posted previously, I guess that you can reproduce.


--
Jean-Pierre


--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Can't create a macro with 2.4.0~devel

2024-02-26 Thread Jean-Marc Lasgouttes

Le 26/02/2024 à 09:59, Jean-Pierre Chrétien a écrit :

Le 26/02/2024 à 09:31, Jean-Pierre Chrétien a écrit :

Dera developers

While updating the French Math manuel, I can't inset the math macro 
required in section 22.3.


LyX crashes with this trace in the command shell:


Forget about it, subsection 22.3 was inserted in the table ending 
section 22.2.

If I paste it in the right place, I can insert( a macro all right.

However, If I try to insert a macro in the table, LyX crashes...


Well, a crash is never a good idea.

I have a question about that. I see that, in theory math macro templates 
are not allowed in Tabular insets (but in practice the test in Test.cpp 
is broken, so it does not work).


Is there a reason why we would not want macro definitions in tables ?

Now I have to understand why it crashes.

JMarc
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Can't create a macro with 2.4.0~devel

2024-02-26 Thread Jean-Pierre Chrétien

Le 26/02/2024 à 09:31, Jean-Pierre Chrétien a écrit :

Dera developers

While updating the French Math manuel, I can't inset the math macro required in 
section 22.3.


LyX crashes with this trace in the command shell:


Forget about it, subsection 22.3 was inserted in the table ending section 22.2.
If I paste it in the right place, I can insert( a macro all right.

However, If I try to insert a macro in the table, LyX crashes...

--
Jean-Pierre


--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel