(Very) late to this very interesting exchange. I can only have a proper sit down at weekends, so I couldn't make it in time, but here is was my submission for a new tool operating as RegexpReplace "^.*".
This is transcribed from my phone, where I usually jot down ideias when I'm not at home.
Feed S n
Wording:
derived from "Line Feed" (LF); also from the verb form "to feed".
Usage:
- used as Feed or Feed "": Clears current buffer content; mimics a new/fresh/clean line (similar to RegexpReplace "^.*" "");
- used as Feed "S": Clears current buffer content AND inserts contents of S, either string or %output% (similar to RegexpReplace "^.*" "string|%output%"); moves pointer to 1;
used as Feed "S" 1: inserts contents of S (string|%output%) at current pointer position (as in 'feeding'S); moves pointer to 1st character after appended content (previously suggested as Splice).
Inconveniences:
Using Feed "" 1 would, in effect, do nothing. (behavior already happens in Replace S S; so no big deal)
I'm leaving this here, as it may inspire others.
EDIT: I just read about Use; and here's an idea: Use S 1: Use contents of S as current input. If the second parameter is set to 1, S is inserted(/spliced? /added? / appended?) at current pointer position.
Just to add that %_output% (note the leading underscore in the variable title) is considered a hidden output by this command, so that abc%_current%def%_TEST% returns the same as abc%_current%def, regardless of the value of %_TEST% set beforehand.
@Florian please consider this as an (appended) bug report, or a request to add a warning in the documentation page, if not (easily) fixable.
As you may have noticed from my WSS contributions, I'm one who prefers one tool with many functions over several tools with one function (although sometimes they are needed).
I could see that Use S 1 might not be considered very in line with the main purpose of Use; not to mention the extra coding work to add a feature to an existing command (that may be bigger than creating a new simpler command from scratch).
Besides, RegexpReplace (the multi-purpose command that it is), serves that task quite well (for my current needs).
Regardless, the idea of inserting a string|%output% at the current pointer position (via a dedicated command) is there, at your discretion.
If it’s a parameter, it makes Use act like Say where it plonks data onto an existing lot.
If it’s a separate command, it might be easier to understand as its own function.
Either method makes distinct use of the pointer as a drop-off point, whereas RegexpReplace can’t position the pointer where needed but slots in the data immediately without commands before-hand (at the risk of special characters like $.*? interfering which might require the less powerful Replace instead).
Apologies for the late reply. Insert S is working exactly as expected, either with a string or an %output% (or even %_output%).
As for SayFormat and UseFormat, underscore-lead outputs are now visible and working as well as any other.
Thank You very much.
PS:
( This line in the documentation can now be edited and the warning regarding underscores removed.)