unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Alan Mackenzie'" <acm@muc.de>
Cc: emacs-devel@gnu.org
Subject: RE: command to fontify whole buffer?
Date: Thu, 22 Sep 2011 07:56:52 -0700	[thread overview]
Message-ID: <BABE6DA813E749E9AE3608642BD59EDE@us.oracle.com> (raw)
In-Reply-To: <20110922143341.GB3134@acm.acm>

> > `font-lock-fontify-buffer' doesn't do it.
> 
> Are you sure?  I thought it did, and looking again at the 
> fine source, it does appear to.

No, I only think I'm sure. ;-)

After calling `font-lock-fontify-buffer', I can search for zones with face
`font-lock-function-name-face', for example, and I can see that there are no
such zones after some minimal portion of the buffer.

> > Marking the whole buffer and using 
> `(font-lock-fontify-region BEG END)'
> > doesn't do it.
> 
> Ditto.

ditto

> > 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?
> 
> jit-lock-fontify-now                 just calls the function
> font-lock-fontify-region             (via a hook) which calls
> font-lock-default-fontify-region     (via another hook).

I believe you, but I'm not seeing `font-lock-default-fontify-region' fontify
everything.  I'm no expert on this at all.  Just going by what I think I see.

> Surely 'fontified DOES do it.  If it has the value t throughout the
> buffer, that buffer is fully fontified, otherwise not.

Perhaps you're right that if I checked that property throughout the entire
buffer it would be sufficient.  Dunno.  I probably didn't try testing it
everywhere.  But if that's the best test for full-buffer fontification then I
would still prefer something simpler/quicker.

> Or have I misunderstood something?

No, no doubt I have.  No doubt I still do. ;-)

> By the way, I drew a diagram of how jit-lock works about 5 years ago,
> tracing the functions which call each other, and the hooks 
> out of which things get hoiked.  Would you be interested in a copy of it?

I guess so; thanks.  But I would mostly be interested in confirmation that you
are right etc.  I do not see (e.g. by searching for property zones) that the
entire buffer gets fontified by `font-lock-fontify-buffer', but you say it
does/should.




  parent reply	other threads:[~2011-09-22 14:56 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 [this message]
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

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=BABE6DA813E749E9AE3608642BD59EDE@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=acm@muc.de \
    --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).