bbatsov / zenburn-emacs

The Zenburn colour theme ported to Emacs
GNU General Public License v3.0
990 stars 269 forks source link

Byte-compile the theme for use with require #314

Closed edwintorok closed 5 years ago

edwintorok commented 5 years ago

I've noticed some differences between zenburn for Vim and Emacs. Here is a PR to adjust some font weights, although the differences are deeper than that, some colors are different when compared to Vim (e.g. the one for constants would be #DCA3A3 instead of #BFEBBF (i.e. red+1 instead of green+4): https://github.com/jnurmine/Zenburn/blob/master/colors/zenburn.vim#L214

I'm assuming that the intent is to match the Vim version of Zenburn as closely as possible given the description in the Readme as a "direct port".

I've also found another Zenburn here, but the colors don't match much better either: https://github.com/djcb/elisp/blob/master/themes/zenburn-theme.el

ksjogo commented 5 years ago

I would say the current version is a lot better than the original zenburn one. Italics are awful to read (and comments are obviously comments anyway) and bold is just to bright compared to the other tokens around it. I would even propose remove all bold from the theme.

edwintorok commented 5 years ago

I can agree that italic doesn't look good on all fonts (it looks nice on Source Code Pro, because it has an italic variant, it is not simply the regular one slanted). I don't have a strong opinion on how constants should look like: keywords are already bold and that is the most important part, so I dropped the commit that changes bold/italic and just left the commit about byte-compilation.

bbatsov commented 5 years ago

Btw, what exactly was the issue with the byte-compilation? I guess that was so long ago I simply don't even remember.

bbatsov commented 5 years ago

I'm assuming that the intent is to match the Vim version of Zenburn as closely as possible given the description in the Readme as a "direct port".

This was the intention originally, but I guess as the years passed we've diverged from the vim theme. Some things that make sense in vim don't make sense in Emacs - e.g. there most modes define their own syntax categories (or at least they did so 10 years ago) and in Emacs there are some predefined syntax categories that most modes stick to. This means in simple terms that major vim modes tend to use inconsistent font-locking compared to Emacs modes.

edwintorok commented 5 years ago

About byte compilation: when I remove the no-byte-compile flag I get a warning that zenburn-default-colors-alist is not defined: zenburn-theme.el:119:1:Error: Symbol’s value as variable is void: zenburn-default-colors-alist Adding eval-when-compile solves that.

Byte compiling the theme should have a small improvement on startup time, and can help spot problems like this one in gruvbox-theme: https://github.com/greduan/emacs-theme-gruvbox/pull/118/commits/471bc7ce3c0d4d1f19931f1ca30c355778cb05da

edwintorok commented 5 years ago

I found one situation where byte-compilation doesn't work: if you use customize to set override colors then byte-compilation would make this not take effect at all becase the colors would be evaluated at compilation time. Thus closing this PR.