unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Ensuring that the whole buffer is fontified
@ 2003-10-21 14:37 Hrvoje Niksic
  2003-10-21 15:25 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Hrvoje Niksic @ 2003-10-21 14:37 UTC (permalink / raw)


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
  fontified.

What approach would you recommend for ensuring buffer fontification?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Ensuring that the whole buffer is fontified
  2003-10-21 14:37 Ensuring that the whole buffer is fontified Hrvoje Niksic
@ 2003-10-21 15:25 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2003-10-21 15:25 UTC (permalink / raw)
  Cc: emacs-devel

> 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.

Yes.  I think ps-print had the same problem.
IIRC, they fixed it, but in an ugly way.  We should add
a `font-lock-fontify-now' which DTRT for all the support modes
and then you can use that and ps-print can use that as well.


        Stefan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-10-21 15:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-21 14:37 Ensuring that the whole buffer is fontified Hrvoje Niksic
2003-10-21 15:25 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).