|
From: Hans-Bernhard B. <br...@ph...> - 2003-10-20 13:09:37
|
On Mon, 20 Oct 2003, Petr Mikulik wrote: > I wanted to let the "save" command to save to file only differences wrt > "reset" status of gnuplot, so I've patched save_command() + surrounding > routines to allow write to pipe. In the attached file, there is that > patch + my favourite script "gpsavediff". I'm somewhat surprised it doesn't already support the "| command" syntax already. Given that, I'm all for integrating this patch ASAP. > Do you do such a diff-save in a similar way? Yes. I salvaged a script similar to yours ages ago, from a mail to info-gnuplot IIRC. It's called 'reduce-gnuplot-output', it's a csh script (of all things), and it only works for named files. A better approach to the whole task would almost certainly be to integrate it into gnuplot itself. But for that to become feasible, we'ld need a massive refactoring of the whole internal status stuff: *) organize the set/show/save/unset/reset implementations by variable, not by command, i.e. the set, show, save, unset and reset (default status) for a given setting should all be in *one* place, not scattered over 4 files (set.c,show.c,unset.c,misc.c). This would make things a lot more OO-ish. *) Add a new method, or a flag to the 'save-variable' method of each setting, so it saves only the state different from the default. *) Add an option to 'save', or a new command 'savediffs' to call that new method. This would be a ton of work, unfortunately. I.e. I'd advise to delay this until after the 4.0 release we all still agree should happen soon --- right? -- Hans-Bernhard Broeker (br...@ph...) Even if all the snow were burnt, ashes would remain. |