On a regular basis I need to open files that have really long lines, which unfortunately causes emacs to grind to a halt. My understanding is that this is a long-term issue with the renderer. I've tried disabling every possible mode, using every possible line wrapping package, etc. but none work well enough.
What I have found does work is first transforming the files in shell before opening them:
$ fold -w80 myfile > temp
Generally speaking I don't need to edit the files that have this property just view them, but it would still be convenient to look at them in emacs instead of going to less
in the terminal. Is it possible to automate this and just have emacs do this every time I open a file that is sufficiently large or that has a sufficiently large first line?
Find file hooks look like they let me run code after the buffer is opened, but in this case I want to intercept the request to open the file and make it open the a synchronously arriving shell command output instead. Preferably in a way that will just work regardless of whether I open the file with helm, dired, etc.