emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inconsistency in font-lock


From: Herbert Euler
Subject: Re: Inconsistency in font-lock
Date: Thu, 26 Apr 2007 23:06:18 +0800

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/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]