[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Ensuring that the whole buffer is fontified

From: Hrvoje Niksic
Subject: Ensuring that the whole buffer is fontified
Date: Tue, 21 Oct 2003 16:37:17 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Rational FORTRAN, linux)

My package htmlize (see
<http://fly.srk.fer.hr/~hniksic/emacs/htmlize.el>) inspects buffer
contents and converts it into HTML markup that includes color and font
information found in the buffer.  This is typically used to convert
fontified buffers to HTML, but is not limited to font-lock.

One problem I encountered with recent versions of GNU Emacs is that it
seems (at least under Red Hat) to use font-lock "support modes" by
default.  The delayed fontification causes htmlize to properly convert
only the first visible screenful of the buffer.

What is the best way to tell font-lock to process the whole buffer
because non-interactive is about to inspect it?  I found several
possibilities, but they seemed incomplete:

* I can call jit-lock-fontify-now for jit-lock, something else for
  fast-lock, and something else for lazy-lock.  But that requires
  htmlize intimate knowledge about the support modes, which will fail
  if a new (possibly third-party) support mode gets added.

* I can call font-lock-fontify-buffer.  But the documentation of that
  function doesn't seem to mention the support modes at all, so I'm
  not sure how they will interact in the general case.  Also, I don't
  want to cause re-fontification if the buffer has already been fully

What approach would you recommend for ensuring buffer fontification?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]