> I am sure that these patches are terrible style, not in keeping with
> the Emacs coding conventions, and totally unportable (I wrote this on
> GNU/Linux) - I just wanted to get out a quick proof of concept.

I can't comment on that but using emacsclient as a PAGER is one of the
top entries in my emacs wishlist.  Thanks for working on that!

Another approach is to use the LESSOPEN feature of "less" to spawn an Emacs in batch mode to perform syntax highlighting, uncompressing files, access remote files via tramp etc.

This is available today using the "e2ansi" package (https://github.com/Lindydancer/e2ansi).

    -- Anders