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

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

htmlize & jdee


From: Cristian Gutierrez
Subject: htmlize & jdee
Date: Sun, 31 Oct 2004 17:51:55 -0300
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Hello,

I'm using htmlize.el to highlight code I find on the web (and loading
the htmlized file back in the browser), and to do so I must use it with
gnudoit or emacs --eval (I prefer the former, but for sanity and bug
isolation purposes, I use the latter in the examples here).

It works just fine for TeX (using AuCTeX font-locking), Perl (using
CPerl's), {X,XHT,SG,HT}ML (using PSGML's), etc. But not for Java code,
for which I use JDEE. I run:

,----
| emacs -q --eval='(progn (toggle-debug-on-error)
|                         (htmlize-file "/tmp/Console.java"))'
`----

And all I get is:

,----
| Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
|   goto-char(nil)
|   eval((goto-char (match-beginning 4)))
|   font-lock-fontify-keywords-region(1 1401 t)
|   font-lock-default-fontify-region(1 1401 t)
|   font-lock-fontify-region(1 1401 t)
|   byte-code("<garbage>" [save-match-data-internal verbose font-lock-fontified 
match-data ((set-match-data save-match-data-internal)) font-lock-fontify-region 
font-lock-after-fontify-buffer t] 4)
|   font-lock-default-fontify-buffer()
|   font-lock-fontify-buffer()
|   htmlize-file("/tmp/Console.java")
|   (progn (toggle-debug-on-error) (htmlize-file "/tmp/Console.java"))
|   eval((progn (toggle-debug-on-error) (htmlize-file "/tmp/Console.java")))
|   command-line-1(("--eval=(progn (toggle-debug-on-error) (htmlize-file 
\"/tmp/Console.java\"))"))
|   command-line()
|   normal-top-level()
`----

Strange thing is, if I start a clean (-q) Emacs, open /tmp/Console.java
(automatically in jde-mode) and do M-x htmlize-buffer, everything works
fine. If in this same context I use htmlize-file RET /tmp/Console.java,
I get "backtraced" again:

,----
| Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
|   goto-char(nil)
|   eval((goto-char (match-beginning 4)))
|   font-lock-fontify-keywords-region(1 1401 t)
|   [...]
| * call-interactively(htmlize-file)
|   execute-extended-command(nil)
|   call-interactively(execute-extended-command)
`----

So, I thought this could be a problem with `htmlize-file', and went this
way:

,----
| emacs -q --eval='(progn (toggle-debug-on-error)
|                         (find-file "/tmp/Console.java")
|                         (htmlize-buffer))'
`----

And then again:

,----
| Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
|   goto-char(nil)
|   eval((goto-char (match-beginning 4)))
|   font-lock-fontify-keywords-region(1 1401 nil)
|   [...]
|   eval((progn (toggle-debug-on-error) (find-file "/tmp/Console.java") 
(htmlize-buffer)))
|   command-line-1(("--eval=(progn (toggle-debug-on-error) (find-file 
\"/tmp/Console.java\") (htmlize-buffer))"))
|   command-line()
|   normal-top-level()
`----

So, my question is: what could be disabling the "scripted" use of
htmlize.el, and at the same time allowing me to use it "by hand" on the
minibuffer? I'm already aware that --batch cannot be used because of
Emacs'font-locking mechanism; I'm not using that.

If of any use, htmlize.el file is the same currently available at
<http://fly.srk.fer.hr/~hniksic/emacs/htmlize.el>, and I have Emacs
21.3.1 and JDE 2.3.3-2 from Debian Sid.

I appreciate any insights on this.


PS: Sorry about the long lines!

-- 
Cristian Gutierrez                      http://www.dcc.uchile.cl/~crgutier
crgutier[@]dcc.uchile.cl                        Jabber:crgutier@jabber.org

43rd Law of Computing:
        Anything that can go wr
fortune: Segmentation violation - core dumped





reply via email to

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