Re: emacs cat



On Wed, 10 Jun 2009 02:12:29 +0200
Hans-Peter Engelund Kristiansen <hpek@xxxxxxxxxx> wrote:

Can emacs be used to cat a file?
I would like to overwrite the shell command "cat" with something that
can show the syntax highlighting of the file.

You can use batch mode to output stuff w/o launching emacs, and it's
actually quite fast.

emacs --batch --eval '(print "hello world")'

I don't know how to make it actually dump colors' escape sequences
along w/ text but I guess it should be done via modes' lisp interface,
if it's possible at all.

On a side note you can use a bit more specialized packages to create
"colored cat". I'd use pygments w/ python (which can do it right out of
the box), but I guess there should be at least one accessible from your
language of choice.

--
Mike Kazantsev // fraggod.net

Attachment: signature.asc
Description: PGP signature



Relevant Pages

  • Re: How I get CPU details?
    ... BS> Is there a shell command I can run which gives me some details ... BS> about the type of CPU I have in my host? ... cat /proc/cpuinfo ...
    (Fedora)
  • emacs cat
    ... I would like to overwrite the shell command "cat" with something that can show the syntax highlighting of the file. ...
    (comp.emacs)
  • Re: Free Space Monster (episode 2)
    ... zeros with a one-line shell command. ... cat /dev/zero> test.txt ... let it run for about 5 minutes, Mark. ...
    (comp.sys.mac.apps)
  • a question about fifo
    ... i run shell command: ... $cat xthua|tee test|mplayer 1.mp3 ... and mplayer start playing the music. ...
    (comp.unix.shell)
  • Perl variable to shell command...?
    ... I am trying to use perl local variable with shell command call. ... I am using array of filename so it is necessary for me to use cat with ...
    (comp.lang.perl.misc)