From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (Johan =?iso-8859-1?Q?Bockg=E5rd?=) Newsgroups: gmane.emacs.help Subject: Re: htmlize from shell Date: Wed, 23 Jun 2004 22:26:02 +0200 Organization: Chalmers University of Technology, Sweden Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1088538847 27781 80.91.224.253 (29 Jun 2004 19:54:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 29 Jun 2004 19:54:07 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 29 21:54:02 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BfOV7-0008Gi-00 for ; Tue, 29 Jun 2004 21:42:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BfOWm-0002wM-Ib for geh-help-gnu-emacs@m.gmane.org; Tue, 29 Jun 2004 15:44:24 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.sunet.se!news01.sunet.se!dd.chalmers.se!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 50 Original-NNTP-Posting-Host: tulkas.dd.chalmers.se Mail-Copies-To: never User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.2 (usg-unix-v) Cancel-Lock: sha1:OPct6MIK9PLn1lZMm8BUIJMS+Po= Original-Xref: shelby.stanford.edu gnu.emacs.help:123919 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:19330 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:19330 nick writes: > Using --load instead, I tried > > emacs -q --no-site-file --batch --load htmlit.el > > with htmlit.el containing the following: > > (setq debug-on-error t) > (load-library "font-lock") > (load-library "htmlize") > (font-lock-mode t) > (htmlize-many-files (list "/home/nick/tmp/297.txt" )) > > I get the following backtrace: [...] You can use something like this: -------- my-htmlize.el ---------------------------------- ;; USAGE: ;; emacs -batch -l my-htmlize.el ;; Note: Writes to stdout ;; Explicitly set the faces. Example: (custom-set-faces '(default ((t (:foreground "#ffffff" :background "black")))) '(font-lock-builtin-face ((t (:foreground "#ff0000")))) '(font-lock-comment-face ((t (:bold t :foreground "#333300")))) '(font-lock-constant-face ((t (:foreground "magenta")))) '(font-lock-function-name-face ((t (:bold t :foreground "Blue")))) '(font-lock-keyword-face ((t (:foreground "yellow3")))) '(font-lock-string-face ((t (:foreground "light blue")))) '(font-lock-type-face ((t (:foreground "green")))) '(font-lock-variable-name-face ((t (:foreground "cyan" :bold t)))) '(font-lock-warning-face ((t (:foreground "red" :weight bold))))) (setq htmlize-use-rgb-map 'force) (require 'htmlize) (find-file (pop command-line-args-left)) (font-lock-fontify-buffer) (with-current-buffer (htmlize-buffer) (princ (buffer-string))) --------------------------------------------------------- You could easily adapt this to htmlize several files etc. -- Johan Bockgård