bbatsov / zenburn-emacs

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

Uncomment and fix the advices that add zenburn-specific font-lock #315

Closed tarsius closed 4 years ago

tarsius commented 5 years ago

For now this is just food for thought and a place to talk.

While working on fixing a regression introduced by #300 I found myself once more longing for better tooling when editing themes. Beside this I also wrote https://github.com/tarsius/kludges/blob/master/kludges.el#L30.

Anyway, don't merge this (yet?), I intend to look into implementing a generalized variant, that could be used by other themes as well.


I originally implemented these advices in #106. They got commented out in 27cee3d in response to #110 and similar reports in prelude's issue tracker.

I just implemented the same thing again, only to find the commented advices once I was done... five years later... it seem I would very much like this.

So I had a look at the reports and it seems pretty obvious what the issue was: just because the major-mode is emacs-lisp-mode, that does not mean that the buffer is visiting a file. And the fix is to check whether the buffer is visiting a file before trying to do something with the buffer-file-name.

Besides reverting the commenting and fixing the bug, this commit also does the following:

bbatsov commented 5 years ago

Anyway, don't merge this (yet?), I intend to look into implementing a generalized variant, that could be used by other themes as well.

So, should I merge this now? ;-)

tarsius commented 4 years ago

So, should I merge this now? ;-)

Yes please.

  1. I no longer intend to implement some generalized variant of this, so there's no point in waiting for that.
  2. 315 proves others are interested in this too.

  3. My reasoning as to why the issues that this originally caused have been address still sounds correct to me.

Note that I have rebased onto master and have incorporated the suggestion to use advice-add from #331.

bbatsov commented 4 years ago

Thanks!