unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jambunathan K <kjambunathan@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: command to fontify whole buffer?
Date: Fri, 23 Sep 2011 10:25:55 +0530	[thread overview]
Message-ID: <811uv7c0x0.fsf@gmail.com> (raw)
In-Reply-To: <jwv62kjj3lb.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Fri, 23 Sep 2011 00:23:00 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> 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. ;-)
>
> Agreed.  We need two functions:
> - font-lock-flush-region (which marks the region for re-fontification).
> - font-lock-ensure-region (which makes sure the region is fontified).
> The functions we have were designed before lazy/jit lock and were
> adjusted in ad-hoc ways when jit/lazy was added.
> For font-lock-ensure-region, you should be able to find sample code for
> an implementation in various packages such as ps-print.el and
> replace.el.

In htmlfontify.el (htmlfontify-buffer), hfy-force-fontification calls
either font-lock-fontify-region (in interactive mode) or
font-lock-fontify-buffer (in non-interactive mode).

The latter funcion in turn calls font-lock-fontify-buffer-function which
apparently points to jit-lock-refontify.

I hope either the htmlfontify-buffer DTRT or it may fail to re-fontify
under certain circumstances.

>         Stefan
>
>

-- 



      reply	other threads:[~2011-09-23  4:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=811uv7c0x0.fsf@gmail.com \
    --to=kjambunathan@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).