Andrew> I agree metrics is not the place. However, at some point you
Andrew> need to go cycling through all insets to find the macro
Andrew> instantiations and call changeArgs(). You need to do this on
Andrew> the same kind of basis as updating the expansion - since both
Andrew> reflect changes in the template. At the moment, the expansion
Andrew> is updated in metrics().

> Can't you do this cycling through the buffer every time the name/number
> of arguments of a macro template is changed?

How do I know when these things have changed? I have essentially added more 
cells for the name & number of args to the macrotemplate class, allowing 
them to be edited directly, just like the expansion or display fields of the 
macro. In my mind, changing the name or number of arguments is no different to 
changing the expansion or display cells. 
Presently, an instantiation of the macro updates it's expansion to reflect 
changes in the template within metrics(). I am not aware of a 
notification/dirty flag or member function that is called once a cell has 
been modified. I agree that ideally, this should only be done when the template 
changes, but that's not what happens with the expansion at the moment & 
presumably 
for good reason?
Please note, I'm not trying to be argumentative. It's just that I tried to
find precedent or hooks for the scheme you've outlined, but couldn't.

andrew

Reply via email to