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: RE: command to fontify whole buffer? Date: Thu, 22 Sep 2011 07:56:52 -0700 Message-ID: References: <8BFD7E6B15F149EA96503B2768DFD6C5@us.oracle.com> <20110922143341.GB3134@acm.acm> 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 1316703446 14513 80.91.229.12 (22 Sep 2011 14:57:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 22 Sep 2011 14:57:26 +0000 (UTC) Cc: emacs-devel@gnu.org To: "'Alan Mackenzie'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 22 16:57:21 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 1R6kiE-0005zx-Ov for ged-emacs-devel@m.gmane.org; Thu, 22 Sep 2011 16:57:19 +0200 Original-Received: from localhost ([::1]:50068 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6kiD-0005h2-Lf for ged-emacs-devel@m.gmane.org; Thu, 22 Sep 2011 10:57:17 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:59474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6kiA-0005gj-At for emacs-devel@gnu.org; Thu, 22 Sep 2011 10:57:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R6ki5-0007jc-NK for emacs-devel@gnu.org; Thu, 22 Sep 2011 10:57:14 -0400 Original-Received: from acsinet15.oracle.com ([141.146.126.227]:24692) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6ki5-0007jP-EG for emacs-devel@gnu.org; Thu, 22 Sep 2011 10:57:09 -0400 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by acsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id p8MEuvEB014797 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 22 Sep 2011 14:56:59 GMT Original-Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p8MEuuep027919 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 22 Sep 2011 14:56:56 GMT Original-Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p8MEuoKZ030619; Thu, 22 Sep 2011 09:56:50 -0500 Original-Received: from dradamslap1 (/10.159.57.136) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 22 Sep 2011 07:56:50 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <20110922143341.GB3134@acm.acm> Thread-Index: Acx5NTcBTA4yp+6rQDi7EPxjqaV45QAALqDQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6109 X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090208.4E7B4CC2.004B:SCFMA922111,ss=1,re=-4.000,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 141.146.126.227 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:144192 Archived-At: > > `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.