From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Herbert Euler" Newsgroups: gmane.emacs.devel Subject: Re: Inconsistency in font-lock Date: Thu, 26 Apr 2007 23:06:18 +0800 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: sea.gmane.org 1177600000 16672 80.91.229.12 (26 Apr 2007 15:06:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 26 Apr 2007 15:06:40 +0000 (UTC) Cc: emacs-devel@gnu.org To: monnier@iro.umontreal.ca, rudalics@gmx.at Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 26 17:06:39 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hh5YM-0006xz-3t for ged-emacs-devel@m.gmane.org; Thu, 26 Apr 2007 17:06:38 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hh5e0-0006kw-Pf for ged-emacs-devel@m.gmane.org; Thu, 26 Apr 2007 11:12:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hh5dw-0006jS-41 for emacs-devel@gnu.org; Thu, 26 Apr 2007 11:12:24 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hh5du-0006h8-37 for emacs-devel@gnu.org; Thu, 26 Apr 2007 11:12:23 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hh5dt-0006gn-Mt for emacs-devel@gnu.org; Thu, 26 Apr 2007 11:12:21 -0400 Original-Received: from bay0-omc2-s4.bay0.hotmail.com ([65.54.246.140]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Hh5Y9-0001n1-0G for emacs-devel@gnu.org; Thu, 26 Apr 2007 11:06:25 -0400 Original-Received: from hotmail.com ([65.55.154.109]) by bay0-omc2-s4.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Thu, 26 Apr 2007 08:06:23 -0700 Original-Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 26 Apr 2007 08:06:23 -0700 Original-Received: from 65.55.154.123 by by143fd.bay143.hotmail.msn.com with HTTP; Thu, 26 Apr 2007 15:06:18 GMT X-Originating-IP: [221.223.209.51] X-Originating-Email: [herberteuler@hotmail.com] X-Sender: herberteuler@hotmail.com In-Reply-To: X-OriginalArrivalTime: 26 Apr 2007 15:06:23.0386 (UTC) FILETIME=[743767A0:01C78814] X-detected-kernel: Windows 2000 SP4, XP SP1+ X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:70189 Archived-At: >Whether the function has it optional or not is not the issue. The issue is >that the code calls it with 3 arguments, so we should just say so rather >than impose that the third be optional. I wrote a package these days, and I called the function. The code is as in the previous message: (if font-lock-defaults (funcall font-lock-fontify-region-function start end nil)) Since the issue is the amount of arguments in codes that actually call it, I think `nil' here is not necessary. For fontifying a region, only the start and end position of the region is needed, whether the fontifying process is "loud" is not necessary. On the other hand, Glenn refered that there is an invocation in font-lock.el, there does be one. Please take a look at it: (defun font-lock-fontify-region (beg end &optional loudly) (font-lock-set-defaults) (funcall font-lock-fontify-region-function beg end loudly)) All of the functions and variables, `font-lock-fontify-region-function', `font-lock-default-fontify-region', and `font-lock-fontify-regin', should be in one form, for consistency. If we say that `font-lock-fontify-region-function' is a function that requires three arguments at least, perhaps we should modify the definition of `font-lock-fontify-region' as well. Regards, Guanpeng Xu Btw, after reading the code, I think I should not use the code above in the package I wrote these days, but the following: (font-lock-fontify-region start end) And I have changed my code. _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/