I agree in general, and will stay silent after this email (I already have a useful modification I can use), but none of the tools mentioned can perform this task in a well thought out and general reusable case.
My counterpoints are:
- Most of the time a hard character limit is a hard character limit. Extending lines would certainly be fine in my case as it was simply a desire to remain consistent with previous work. But I know with many code bases it's a hard requirement so ensuring shorter lines would be of great usefulness there.
- Having the functionality be a part of fold would allow it to be very general and avoid needing to write a specialized or very lengthy script for each character involved (backslash is a special case, and so are some chars that require extra formatting magic to work in the shell script so it can't be generalized very easily)
- The approach suggested by you is fuzzy and not exacting. The "current" line would be truncated, but the next would be extended. So if you were looking for well formatted code, then you would need to use conditional shell magic to handing re-adjusting the line length of following lines after shuffling the "special char" to the next line. As far as I can see you cannot reliably handle special characters, and exacting length with reliable fallback behavior (mostly 80 char with 79 fallback; mostly 80 char with 81 fallback), without an inordinate amount shell scripting magic.
I fully appreciate your charge of protecting the coreutils code base but also believe this behavior is well worth the extra code base.
Anyways, this is the last time you'll hear from me on this topic if you further disagree, and I will happily continue on my merry way:)
~Kyle