kunalb / poet

An emacs theme that's well suited for modes using variable pitch: particularly org-mode and markdown-mode.
MIT License
516 stars 15 forks source link

Causes error with `htmlize-merge-two-faces` #15

Open emsenn opened 5 years ago

emsenn commented 5 years ago

Hey there,

This might not be a bug with your theme at all; I'm too novice of an Emacs user to be sure, but:

When I try and export a buffer containing a source block which is set to a mode which uses variable pitch font itself (such as an org-mode source block), I receive the following error upon attempting to export to HTML

htmlize-merge-two-faces: Wrong type argument: number-or-marker-p, (lambda (base) (truncate (* (face-attribute (quote fixed-pitch) :height nil (quote default)) 1.23)))

This only occurs on buffers containing variable-width source blocks; I've tested it against a markdown and org-mode source block.

Let me know if there's any more info I can provide.

(Also, while I'm here, you've made an amazing theme.)

kunalb commented 5 years ago

Thanks for the report! I've noticed that one – and dug into it a little a few days ago – and it's an htmlize bug unfortunately; it can't handle dynamic font-face sizes and tries to multiply the lambda with a base value =/. I had to use lambdas to account for a different bug where font sizes aren't available for emacs instances started as a server, so they need to be updated when the first client is created.

I should get around to doing an explicit bug report to htmlize at some point.

Quick alternatives to unblock you:

emsenn commented 5 years ago

Thanks for the quick response and suggested answers. Since this bug lies outside this repository, I'd recommend giving it a tag such as "upstream-bug" to indicate its unfixable nature, and perhaps closing it.