From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: command to fontify whole buffer? Date: Thu, 22 Sep 2011 06:32:49 -0700 Message-ID: <8BFD7E6B15F149EA96503B2768DFD6C5@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1316698393 7955 80.91.229.12 (22 Sep 2011 13:33:13 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 22 Sep 2011 13:33:13 +0000 (UTC) To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 22 15:33:10 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R6jOl-00013Z-Tf for ged-emacs-devel@m.gmane.org; Thu, 22 Sep 2011 15:33:08 +0200 Original-Received: from localhost ([::1]:40097 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6jOl-0000Mp-1i for ged-emacs-devel@m.gmane.org; Thu, 22 Sep 2011 09:33:07 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:48350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6jOc-0000MO-IG for emacs-devel@gnu.org; Thu, 22 Sep 2011 09:33:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R6jOb-00065U-GJ for emacs-devel@gnu.org; Thu, 22 Sep 2011 09:32:58 -0400 Original-Received: from rcsinet15.oracle.com ([148.87.113.117]:21141) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6jOb-00065G-B8 for emacs-devel@gnu.org; Thu, 22 Sep 2011 09:32:57 -0400 Original-Received: from rtcsinet21.oracle.com (rtcsinet21.oracle.com [66.248.204.29]) by rcsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id p8MDWsTF028385 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 22 Sep 2011 13:32:56 GMT Original-Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by rtcsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p8MDWrIq026179 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 22 Sep 2011 13:32:53 GMT Original-Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p8MDWlxR005365 for ; Thu, 22 Sep 2011 08:32:47 -0500 Original-Received: from dradamslap1 (/10.159.57.136) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 22 Sep 2011 06:32:47 -0700 X-Mailer: Microsoft Office Outlook 11 Thread-Index: Acx5LB8eV4FVf9A0Su6e2wnIQtpewQ== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6109 X-Source-IP: rtcsinet21.oracle.com [66.248.204.29] X-CT-RefId: str=0001.0A090203.4E7B3908.00A6,ss=1,re=0.000,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 148.87.113.117 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:144187 Archived-At: 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?