I want to create a function such that when I execute it (:'<,'>call Foo()) with some text selected, it will set my command-line as ':%s/selected_text/selected_text/gc' so that I can edit the destination pattern manually before executing
I can write the function to execute the substitute command but
- command-history will not have that execute command, only the
call Foo()line - that would still be less than ideal as I would prefer if I could avoid executing at all
Is there a 'set command-line' command maybe?

<CR>at the end of the constructed command-line.