[Top][All Lists]

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

Re: Inconsistency in font-lock

From: Stefan Monnier
Subject: Re: Inconsistency in font-lock
Date: Thu, 26 Apr 2007 10:04:59 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.97 (gnu/linux)

>>> It's not nice.  We should write:
>>> (defun font-lock-default-fontify-region (beg end &optional loudly)
>> I think we should fix the docstring instead and just say that the function
>> is called with 3 arguments.  How that function accepts them is irrelevant
>> (the function may have 4 optional arguments if the programmer feels like
>> it).

> I have no strong opinion.  XEmacs has it optional ever since, IIRC.

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.
Check the docstring of other foo-function(s) variables and you'll see that's
how we normally document them:

   after-change-functions is a variable defined in `C source code'.
   Its value is nil
   List of functions to call after each text change.
   Three arguments are passed to each function: the positions of
   the beginning and end of the range of changed text,
   and the length in bytes of the pre-change text replaced by that range.

The after-change-functions can of course decide to leave the 3rd argument
as optional.


reply via email to

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