From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: command to fontify whole buffer? Date: Fri, 23 Sep 2011 00:23:00 -0400 Message-ID: References: <8BFD7E6B15F149EA96503B2768DFD6C5@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1316751791 5372 80.91.229.12 (23 Sep 2011 04:23:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 23 Sep 2011 04:23:11 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Drew Adams" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 23 06:23:07 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 1R6xI3-0006jl-3O for ged-emacs-devel@m.gmane.org; Fri, 23 Sep 2011 06:23:07 +0200 Original-Received: from localhost ([::1]:51286 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6xI1-0000D7-0j for ged-emacs-devel@m.gmane.org; Fri, 23 Sep 2011 00:23:05 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:60636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6xHy-0000D1-7u for emacs-devel@gnu.org; Fri, 23 Sep 2011 00:23:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R6xHx-0002FB-5c for emacs-devel@gnu.org; Fri, 23 Sep 2011 00:23:02 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:56309 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6xHx-0002F7-2x for emacs-devel@gnu.org; Fri, 23 Sep 2011 00:23:01 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAOkIfE5MCqQE/2dsb2JhbABDqAh5gVMBAQQBViMFCws0EhQYDSSIC7UGhn0EoFiEQw X-IronPort-AV: E=Sophos;i="4.68,427,1312171200"; d="scan'208";a="137995786" Original-Received: from 76-10-164-4.dsl.teksavvy.com (HELO ceviche.home) ([76.10.164.4]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 23 Sep 2011 00:23:00 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 45191660B6; Fri, 23 Sep 2011 00:23:00 -0400 (EDT) In-Reply-To: <8BFD7E6B15F149EA96503B2768DFD6C5@us.oracle.com> (Drew Adams's message of "Thu, 22 Sep 2011 06:32:49 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:144214 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. ;-) 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. Stefan