
2012/6/11 mathog <mathog@...1176...>:
The problem with "Vacuum Defs" is that a naive user will likely have no idea why it needs to be called in the first place. Place me in a related category - I have yet to find an instance where I would not have wanted vacuum defs to have run automatically whenever a definition was left dangling, but I have had to use vacuum defs many times to clean out these leftovers.
What about making vacuum defs the default on an optional action which occurs whenever a file is saved as an SVG?
Vacuum defs causes loss of data (e.g. it can remove complex patterns or gradients). In general it is very wrong to lose user data without an explicit action. There could be a checkbox that says 'Vacuum defs on save' that defaults to off. I don't think the ability to perform an arbitrary action is really that useful; adding specific things that can happen when saving (vacuum defs, exporting to specified formats) is better.
Vacuum defs on save would make it impossible to purposefully include unused defs in a file, for example when storing a few often used gradients in a blank document template, or at least prevent people from using Inkscape to create such documents.
Regards, Krzysztof