I would like to use emacs in some kind of batch mode to just display the file with syntax highlighting and output. In particular, I want to flush the buffer with the buffer using ANSI escape codes so that it looks syntactically allocated enough on my terminal. Is there any way to do this?
The ansi-lpr.el library seems similar to what I want, but the result is not colored, I can’t figure out how to overcome this last hurdle - there are many modules to digest ANSI escape codes in Emacs text properties (for example, ansi- color.el ), but I did not find anything that would do the opposite. If someone can point me to something that does, I think I can put it all together.
As an alternative, I saw some hacker approaches, such as this answer (using scriptand fixing the output), but in my experiments this approach would hardly be useful - you get tons of unwanted control sequences mixed with the selected text.
The general motivation here is to use emacs in the channel $LESSOPENto get syntax highlighting when working with page files. In case you say that, I tried and "just page files in Emacs" is not suitable for me.
Peter source
share