all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* command to fontify whole buffer?
@ 2011-09-22 13:32 Drew Adams
  2011-09-22 14:33 ` Alan Mackenzie
  2011-09-23  4:23 ` Stefan Monnier
  0 siblings, 2 replies; 13+ messages in thread
From: Drew Adams @ 2011-09-22 13:32 UTC (permalink / raw)
  To: emacs-devel

Sometimes I want to fontify a whole buffer (really).  One use case is to be able
to then use the fontification for other (e.g. code) purposes than visual
highlighting.  But it really doesn't matter why - I just want to. ;-)

With the current lazy/jit fontification, I see no command to do that.
`font-lock-fontify-buffer' doesn't do it.  Marking the whole buffer and using
`(font-lock-fontify-region BEG END)' doesn't do it.

Digging more than a bit, I finally found non-interactive function
`jit-lock-fontify-now', which seems to do the trick.  Why not provide a command
that does it?

(defun fontify-buffer-completely-no-but-really ()
  "Yes, really, completely, right now."
  (interactive)
  (jit-lock-fontify-now))

Oddly enough, the `jit-lock-fontify-now' doc is no different from the doc of all
the other `fontify' functions that do _not_ really, necessarily fontify
everything they apply to.  They all say only that they fontify.  The others do
not say that they don't really, necessarily fontify all they apply to.  And this
function doesn't say that it is any different from the others.  But it seems to
be.

Another question is whether there is some condition that can be tested to know
whether a buffer has really been completely fontified (whether or not that
fontification is completely up-to-date because of subsequent edits).  Text
property `fontified' does not indicate this - is there something that does?




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

end of thread, other threads:[~2011-09-25 20:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-22 13:32 command to fontify whole buffer? Drew Adams
2011-09-22 14:33 ` Alan Mackenzie
2011-09-22 14:46   ` Lennart Borgman
2011-09-22 15:33     ` Alan Mackenzie
2011-09-22 17:30       ` Dave Abrahams
2011-09-22 22:31         ` Lennart Borgman
2011-09-22 14:56   ` Drew Adams
2011-09-22 15:27     ` Alan Mackenzie
2011-09-22 15:43       ` Drew Adams
2011-09-22 22:34       ` Lennart Borgman
2011-09-25 20:54       ` Nix
2011-09-23  4:23 ` Stefan Monnier
2011-09-23  4:55   ` Jambunathan K

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.