There are two other questions asking this, but one accepted an answer that didn't help, and the other lacked detail.

To reproduce:

  • Ubuntu 14.04 running emacs-snapshot from ppa.launchpad.net/ubuntu-elisp/ppa/ubuntu
  • Fire up emacs -Q.
  • M-x org-version => Org-mode version 8.2.10 (release_8.2.10 @ /usr/share/emacs/25.0.50/lisp/org/)
  • M-x emacs-version => GNU Emacs (x86_64-pc-linux-gnu, GTK+ Version 3.10.8) of 2015-10-26
  • eval (setq org-src-fontify-natively 't)

Then make a tiny example:

* Simple Program

Voila: in the message buffer org-mode fontification error [15 times].

How can I fix the fontification, so my buffers look pretty and my exports work?

  • I have seen this issue once but it got resolved. I believe it was due to mixed installations of org-mode versions. But I am not sure; and also you mentioned that you see this in emacs -Q session. Nov 3 '15 at 16:09
  • Seeing the same problem. Using org-plus-contrib installed from org site with emacs 25.2. Have ensured the org-plus-contrib package is loaded before anything uses org mode, so can't see anything which would result in the build-n/GNU version being loaded and thus causing conflicts. Anyone able to enlighten me on what they did to solve this issue?
    – Tim X
    Feb 25 '17 at 6:15

OK, I think I've narrowed this down (at least for my case). the problem appears to be with goto-address-prog-mode. Below is a minimal init.el which will load the latest org-plus-contrib from org and a simple test.org file. I start emacs with

/usr/local/bin/emacs -q -l ./init.el --debug-init

and will get the org-mode fontification error message when I open test.org. Remove the hook line to load goto-address-prog-mode and all is OK. If I use the org-mode which comes with emcas 25.1, no error.

The init file is

(require 'package)

(setq package-enable-at-startup nil)
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/"))

(unless (package-installed-p 'org-plus-contrib)
  (package-install 'org-plus-contrib))

(require 'org)

(require 'goto-addr)

(add-hook 'prog-mode-hook 'goto-address-prog-mode)

and the test.org file is simply

 * Test   
   This is a simple test org file

   #+BEGIN_SRC emacs-lisp
     (message "A Test")  

This is emacs 25.1 running on Ubuntu built from the tarball.

GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.9) of 2017-02-25

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.