On Mon, Dec 23, 2013 at 5:54 AM, Jean-Marc Lasgouttes <lasgout...@lyx.org> wrote: > 23/12/2013 11:45, Scott Kostyshak: > >> I find inset-forall a useful LFUN and using it would have been the >> answer to several questions I've seen if those insets had layoutName >> methods. (Most of those questions have to do with removing all insets >> of a certain type.) >> >> Further motivation is that I'm guessing layoutName could be useful in >> other places of LyX. Right now it is only used in a few diagnostic >> messages. >> >> I would like to propose that a layoutName method be added to all >> current insets (I volunteer to do this work) and that it be required >> that future insets define this method. > > > Sounds like a good idea. Even better would be to define a name and an > optional subtype for insets in a generic way. Currently this subtype (type > of note, of box...), which is used in layoutName(), is defined in a ad-hoc > way in each inset. Having this stuff accessible in a generic way would be > useful beyond the layout name, IMO. The layout name is just a string > representation of this information.
Sounds better indeed. So this would be a new class/typedef? Inset would get a new data member? In addition to type and subtype, we could allow for a "instance label" to accommodate insets whose layoutName depends on something else (InsetFlex and InsetBranch)? Do you propose to have layoutName still return a docstring, but in a generic way (i.e. it would not be virtual)? Or do you propose to have it return the new data member and how it is used is up to the caller? And then inset-forall could work on all insets in a certain type (without regard to sub-type)? As you can see by the number of question marks, I'm interested but not sure about the details. Scott