On 05/15/15 10:04, Jean-Marc Lasgouttes wrote:
Le 14/05/15 22:31, Guillaume M-M a écrit :
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.

I see it better now. It does not make much sense though that this is
possible with a macro and not with \frac.

I agree.


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.

I would do that by putting different definitions of the same macro in
different branches. But this may not be exactly what you are after.

No indeed, I am speaking of something else. For instance we can use copy/paste on one equation because only a few details have to be changed. Or simply we can change our mind during the typesetting of a proof: writing an article does not go in a straight line.


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?

I do not think you are missing something. Obviously, changing macro
would be possible as long as the parameters of the macros have the same
structure. But switching from a two parameters macro to a one parameter
one is trickier.

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.

Well it indeed clarifies that macro-unfold is a very weird concept :)

For these implementation details I agree---but if the question is "how do we change the name of a macro in a way that has the same features (e.g. completion) as inserting the macro in the first place", then the idea of unfolding is quite natural.

Sorry for not being familiar enough with the source code to make more constructive suggestions.


Guillaume

Reply via email to