From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: Emacs Schell Scripting Date: Wed, 25 Mar 2009 17:02:19 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1238057512 14955 80.91.229.12 (26 Mar 2009 08:51:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Mar 2009 08:51:52 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 26 09:53:09 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LmlKm-00083s-PF for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Mar 2009 09:53:09 +0100 Original-Received: from localhost ([127.0.0.1]:44113 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LmlJP-0004f4-Ox for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Mar 2009 04:51:43 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!z16g2000prd.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Lines: 45 Original-NNTP-Posting-Host: 24.6.175.142 Original-X-Trace: posting.google.com 1238025740 17646 127.0.0.1 (26 Mar 2009 00:02:20 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 26 Mar 2009 00:02:20 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z16g2000prd.googlegroups.com; posting-host=24.6.175.142; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:167988 comp.emacs:98067 X-Mailman-Approved-At: Thu, 26 Mar 2009 04:48:36 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:63283 Archived-At: On Mar 25, 6:26 am, Volkan YAZICI 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: =E2=80=A2 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 =E2=88=91 http://xahlee.org/ =E2=98=84