1

When I load up emacs for the first time I get this warning

Warning (bytecomp): ‘font-lock-fontify-buffer’ is for interactive use only; use ‘font-lock-ensure’ or ‘font-lock-flush’ instead. [2 times]

Is this something I could be concerned with?

edit

I found the culprit:

 (use-package indent-guide
   :ensure t
   :config
   (indent-guide-global-mode)
   (setq indent-guide-char "|"))
2

Something in your init file is invoking font-lock-fontify-buffer. You can track it down and see if you want to change it as suggested by the warning. Or you can ignore it.

Emacs has added a ton of byte-compilation warnings in recent years. Most can be ignored, in the sense that there will be no negative effects. Most of the time they serve mainly as suggestions to library writers to update code.

But even in that context many, perhaps most, can and should be ignored. If a library supports older Emacs versions as well as newer ones, and if it handles this cohabitation properly, such warnings will likely result. This is simply because the byte-compiler analysis cannot determine that they in fact do the right thing. Its analysis is pretty primitive, even though it can be helpful by drawing attention to something that a library author might want to check.

And yes, even though you are not explicitly byte-compiling anything when you load your init file, the byte-compiler can kick in and do some work. So you can get byte-compiler warnings without being aware that you are byte-compiling.

To your bottom-line question: You can ignore this particular warning. Nothing bad will come from code that invokes font-lock-fontify-buffer from Lisp. In some cases the result will not be what the author might have hoped for, but there is no risk for you from such a Lisp invocation.

If you are curious about which part of your init file causes this, you can recursively bisect the file to find the culprit. You can use command comment-region to comment out a selection of text (and with C-u to uncomment a selection). Comment out 1/2 of the file, then 3/4, 7/8, etc., to narrow it down to find which part leads to the warning.

  • Thanks for your reply. I am trying to use emacs for Ruby on Rails and have successfully got projectile-rails, inf-ruby, and such working. I noticed when I load emacs for the first time I get a crap ton of warnings. I think it as you describe i.e. older packages. I am using use-package as well and was not sure if that in part was contributing to this. Everything does work though or seems to be... – codingdraculasbrain Apr 22 '17 at 1:34
  • It is warnings that turn out to be useless in a given context that are crap, and can be ignored. It is not (necessarily) the code that gives rise to them that is crap. ;-) – Drew Apr 22 '17 at 1:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.