help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs Schell Scripting


From: Xah Lee
Subject: Re: Emacs Schell Scripting
Date: Wed, 25 Mar 2009 17:02:19 -0700 (PDT)
User-agent: G2/1.0

On Mar 25, 6:26 am, Volkan YAZICI <address@hidden> wrote:
> Hi,
>
> I have written a small wrapper shell script over htmlize.el to output
> syntax highlighted forms of buffers into HTML files. (Why bothering
> with syntax highligting libraries while there is emacs already?) But
> I'm having some troubles with command line arguments in emacs shell
> scripts. Consider below output:
>
>   $ cat example.el
>   #!/usr/local/bin/emacs --script
>   (message "ARGV: %s\n" command-line-args)
>
>   $ ./example.el foo bar baz
>   ARGV: (/usr/local/bin/emacs -scriptload ./example.el foo bar baz)
>
> In the initialization of my program, I create a custom args variable:
>
>   (defvar args (cons (first command-line-args) (subseq command-line-
> args 3)))
>
> But isn't there a more portable and concise way of doing this? (OTOH,
> I don't know if "-scriptload ./example.el" part differs between
> different emacs versions.)

dont' have answer to your question specifically...  but, there are at
least 2 robust packages that do what you want already.

I use htmlize.el by Hrvoje Niksic.
at http://fly.srk.fer.hr/~hniksic/emacs/htmlize.el

For a tutorial, pls see:

• Elisp: Syntax Coloring Source Code In HTML
  http://xahlee.org/emacs/elisp_htmlize.html

Also, at the bottom of the above page, you'll see that google has
released a js code that syntax color source code as presented in html
with the pre tag, without needing span markup, and does it in real
time. It is fast, small, and works for many langs.

  Xah
∑ http://xahlee.org/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]