hniksic / emacs-htmlize

Convert buffer text and decorations to HTML.
193 stars 44 forks source link

Error on htmlizing region #6

Closed se4u closed 7 years ago

se4u commented 7 years ago

Hi, I was wondering if you could figure out why I might be getting the following error when I call htmlize-region: Wrong type argument: number-or-marker-p, (nil . 100)

I toggled debug-on-error and I got the following backtrace which shows that the parameters to the sort function are wrong but I couldn't really see how to fix this wrong key that is being fed to the sort function

debug(error (wrong-type-argument number-or-marker-p (nil . 100)))
  <((nil . 100) 110)
  #[514 "\300   !  !\"\207" [< cl-key] 6 "\n\n(fn CL-X CL-Y)"](#<overlay from 1 to 1087 in benchmark.py> #<overlay from 1 to 7 in benchmark.py>)
  sort((#<overlay from 1 to 7 in benchmark.py>) #[514 "\300 !  !\"\207" [< cl-key] 6 "\n\n(fn CL-X CL-Y)"])
  cl-sort((#<overlay from 1 to 7 in benchmark.py>) < :key #[257 "\300\301\"\206\302\207" [overlay-get priority 0] 4 "\n\n(fn O)"])
  apply(cl-sort (#<overlay from 1 to 7 in benchmark.py>) < (:key #[257 "\300\301\"\206\302\207" [overlay-get priority 0] 4 "\n\n(fn O)"]))
  stable-sort((#<overlay from 1 to 7 in benchmark.py>) < :key #[257 "\300\301\"\206\302\207" [overlay-get priority 0] 4 "\n\n(fn O)"])
  htmlize-faces-at-point()
  htmlize-buffer-1()
  htmlize-region(1 1087)
  funcall-interactively(htmlize-region 1 1087)
  call-interactively(htmlize-region record nil)
hniksic commented 7 years ago

Thanks for the report. Do you maybe have steps to reproduce the error?

se4u commented 7 years ago

Hi @hniksic the issue went away after I restarted emacs so I guess just adding a hint to the README will be enough. Thanks for this great package.

gilbertw1 commented 7 years ago

Hi, I'm seeing this exact same issue and am not able to resolve it by restarting emacs, or any other means. I am able to call html-buffer just fine, however htmlize-region always fails with that exact same error.

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p (nil . 100))
<((nil . 100) 99)
#[514 "\300 !  !\"\207" [< cl-key] 6 "\n\n(fn CL-X CL-Y)"](#<overlay from 50652 to 51034 in BrandController.scala> #<overlay from 50652 to 51034 in BrandController.scala>)
sort((#<overlay from 50652 to 51034 in BrandController.scala>) #[514 "\300  !  !\"\207" [< cl-key] 6 "\n\n(fn CL-X CL-Y)"])
cl-sort((#<overlay from 50652 to 51034 in BrandController.scala>) < :key #[257 "\300\301\"\206\302\207" [overlay-get priority 0] 4 "\n\n(fn O)"]))
  stable-sort((#<overlay from 50652 to 51034 in BrandController.scala>) < :key #[257 "\300\301\"\206\302\207" [overlay-get priority 0] 4 "\n\n(fn O)"])
  htmlize-faces-at-point()
  htmlize-buffer-1()
  htmlize-region(50652 51034)
  funcall-interactively(htmlize-region 50652 51034)
  call-interactively(htmlize-region record nil)
  command-execute(htmlize-region record)
  #[257 "\304\305!\203\f

I've only just used htmlize for the first time, and simply calling htmlize-region interactively is failing for me. I tried it on files of different types and sizes and it continues to fail. Any guidance would be appreciated!