From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: no-spam@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.bugs Subject: Re: Font-lock: Major mode should be able to specify region to fontify. Date: 11 May 2002 00:40:05 +0200 Organization: StormWare Sender: bug-gnu-emacs-admin@gnu.org Message-ID: <5xg00zd3ui.fsf@kfs2.cua.dk> References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1021066924 4231 127.0.0.1 (10 May 2002 21:42:04 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 10 May 2002 21:42:04 +0000 (UTC) Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 176I9M-000168-00 for ; Fri, 10 May 2002 23:42:04 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 176I9W-0007S9-00; Fri, 10 May 2002 17:42:14 -0400 Original-Received: from dread01.news.tele.dk ([193.88.15.197]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 176I6k-0006zV-00 for ; Fri, 10 May 2002 17:39:22 -0400 Original-Received: (from news@localhost) by dread01.news.tele.dk (8.11.6/8.11.6) id g4ALdKW94782; Fri, 10 May 2002 23:39:20 +0200 (CEST) (envelope-from news) Original-To: gnu-emacs-bug@prep.ai.mit.edu Original-Newsgroups: gnu.emacs.bug User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50 Original-Lines: 29 Original-NNTP-Posting-Host: 80.62.38.68 Original-X-Trace: 1021066759 dread01.news.tele.dk 97288 80.62.38.68 Original-X-Complaints-To: abuse@post.tele.dk Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:1285 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:1285 none@example.invalid (Alan Mackenzie) writes: > I have implemented this feature in font-lock.el (and friends) by creating > a new abnormal hook variable which, if set, is called by one of the > font-lock after-change functions. Here is the patch. The context-diff > is based on the source files from Emacs 21.1. > * font-lock.el > New abnormal hook before-font-lock-after-change-function, > New function font-lock-run-before-after-change-hook. > Changed font-lock-after-change-function. I think your patch is ok as such, but I found the naming of the font-lock-run-before-after-change-hook function rather confusing (ending in -hook). Maybe font-lock-get-buffer-specific-region is a better name? Also, the name of the hook function variable should start with font-lock-, and it's name really doesn't tell anything about what it does. IMO, a better name would be font-lock-buffer-specific-region-function. As a proof of concept, do you have code (using this) for awk-mode to fix the problem you wanted to solve? -- Kim F. Storm http://www.cua.dk