On 05/14/15 20:37, Jean-Marc Lasgouttes wrote:
Le 14/05/2015 21:00, Georg Baum a écrit :
Jean-Marc Lasgouttes wrote:

I think I do not understand yet what an argumentproxy really is. Could
you explain that to me (again??)?

It is a dummy inset that can be used like a MathInset from outside, but
forwards every work to the math macro cell that it represents. This
allows
to store the expanded cells in a standard MathData, and it also allows to
manage the cells like any other math inset if they are detached from the
macro (well it would allow that if the bug we are currently discussing
would not exist).

Is there one per macro use or one per argument?

Would it make sense for the macro inset to hold a copy of the argument
proxy instead of a pointer? And then this copy would be somehow updated
as needed.

It is the other way round: The proxy holds a pointer to the math macro.

Could we make a copy of the macro, then?

What is math macro unfolding exactly?

In folded mode, the macro itself is not drawn unless you enter it,
then the
name is drawn in light grey at the top left corner. In unfolded mode, the
macro name is drawn like ERT, and you can change it.

I had to grep the code to understand how to unfold a macro. And now that
I have tried it, I am not so sure why it is useful. Moreover it uses
bindings that are not accessible with my french kbd. Why doesn't this
use inset-toggle? Why isn't macro-fold a toggle?

JMarc



Dear Jean-Marc,


"Macro power user" here, as Georg wrote...

My typical use case is to change the macro while keeping the same arguments. In the absolute, it is easy to see that this can be useful occasionally at least. Indeed, in the absence of macro-unfolding, the alternative is to copy and paste the arguments one by one from the old macro to the new macro. With unfolding, one just edits the name of the macro, benefiting from name completion, etc.

But, also, once one is aware of unfolding, one can start using it more systematically, because one can define similar, but different, macros, and switch between them when it is needed. (I can give you practical examples if you want...) I currently do not know how to achieve something similar without unfolding.

In fact, I do not care so much about macro unfolding itself than the possibility of changing the macro in-place (with name completion). Am I missing anything?

About toggling, they had this discussion before some years ago: <http://marc.info/?l=lyx-devel&m=122071560319193&w=1>. I admit that I don't use repeated unfolding so much. In addition, I do not use macro folding because the macros folds itself automatically once the name is changed. (But if other power users of unfolding and folding are reading this they will surely speak up, right?)

I hope this clarifies.


Best
Guillaume

Reply via email to