> I believe this doesn't work, function parameters are always lexically bound.
Indeed, there is even a warning from disassemble about the lexical argument shadowing the dynamic one.
Thank you for noticing that.
So I think your first patch was fine.
To recap, the first patch also redefines "ido-fallback-command" so that it accepts an optional parameter (the fallback command).
Is that ok for you? The idea was to let Ido be exited with a custom fallback command through a function, and without requiring other packages to set a variable directly.