Closed krader1961 closed 3 years ago
Also, I ran this against my ~/.config/elvish directory as it existed before my previous invocation of this tool. With the exception of the removal of the code that was so old it had parse errors.
Please close this as soon as you determine there is no reasonable way to obviate problems caused by running the tool twice in a row.
The tool is supposed to be idempotent; at least it shouldn't turn a valid Elvish program into an invalid one. Can you share more of script after one conversion that becomes invalid after the second run?
@krader1961 looking at the code you are having problematic it seems to be a result not of running the tool twice, but with an empty argument list? That was raised in #4 and fixed now.
@xiaq Yes, that is precisely the problem I ran into. This
set edit:insert:binding[Ctrl-R] = []{ interactive:history >/dev/tty 2>&1 }
was being translated to this
set edit:insert:binding[Ctrl-R] = {||] interactive:history >/dev/tty 2>&1 }
The errors I saw from running the migration tool was apparently due to my elvish and associated source being ~2 months old.
This is just a FYI. I do not actually expect any changes to accommodate this scenario. I accidentally ran this tool twice in a row using the latest version of the tool as I write this:
That resulted in a sequence of errors like this:
Which is not at all surprising yet still surprised me. It made we ponder whether it is possible to do better by only converting a file once? The obvious approach is to add a prefix, such as "# elvish 0.17.0\n", to the transformed output. The presence of that prefix causes the conversion tool to ignore the file. That, however, is a fragile mechanism with ambiguities. I don't expect this to be resolved but wanted to document the problem in case there was an obvious (other than to me) solution.