undivert to a file
George W Patrick <[email protected]> Thu, 24 Nov 2016 10:49:26 -0600
| Newsgroups | gmane.comp.gnu.m4.general |
|---|---|
| Message-ID | <[email protected]> |
On the GNU m4 home page it says to send suggestions for m4 extensions here. My suggestion is to be able to undivert to a file. So, divert(1) here is some text divert(0) undivertf(1, `filename.txt') saves the diversion to the stated file, replacing it. Additionally, undivertf(1, `dir1/dir2/filename.txt') would create dir1 and dir1/dir2 if they do not already exist. I currently have obtained this function by programming a filter on the back end of m4, but it would be nice to have it in m4 proper.