On Wednesday, 31 January 2018 09.48.50 WET Jean-Marc Lasgouttes wrote: > It would be nice if we were able to translate lyxformat values that > correspond to stable release to a nicer name. For example, -22x.lyx~ > instead of -lyxformat-508.lyx~, or even .22.lyx~, a bit like what export > as 2.2.x does. However I do not know where to get this information from.
FWIW I wholeheartedly agree with you. :-) Even I find it strange to have those numbers there. One option would be to have a map or a list of tuples (data structures) with the information in there, such that if the file format is between two stable versions it gets upgrade to the next version. I am suggesting that format 508 -> .22.lyx format 509 -> .23.lyx This duplicates the information that we have in lyx2lyx but since we only update it once for each stable release it is a more than acceptable compromise. > A solution would be to let lyx2lyx do the backup itself (with a relevant > command) instead of hardcoding it in Buffer.cpp. That can be done, it is quite easy to do it in lyx2lyx. I have it also on my list to do this for other scripts, the obvious choice (taken from sed man page) is: -i[SUFFIX], --in-place[=SUFFIX] edit files in place (makes backup if SUFFIX supplied) If we agree that this is the way to go this can be done easily. We get the filename to convert, rename it with the suffix, and write the converted file to the usual location. > Now that I think if it, this is how things should have been done from > the beginning. +10^100 (a huge +1) :-) > José, are you reading this? This is one of the issues that I had in my list for 2.4, with an eye to backport it for 2.3. > JMarc -- José Abílio