unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Herbert Euler" <herberteuler@hotmail.com>
To: monnier@iro.umontreal.ca, rudalics@gmx.at
Cc: emacs-devel@gnu.org
Subject: Re: Inconsistency in font-lock
Date: Thu, 26 Apr 2007 23:06:18 +0800	[thread overview]
Message-ID: <BAY143-F291208A268E705C0F65780DA480@phx.gbl> (raw)
In-Reply-To: <jwv8xcf2q2b.fsf-monnier+emacs@gnu.org>

>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	other threads:[~2007-04-26 15:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-25 15:35 Inconsistency in font-lock Herbert Euler
2007-04-25 20:54 ` martin rudalics
2007-04-26  3:13   ` Glenn Morris
2007-04-26  3:32   ` Stefan Monnier
2007-04-26  4:17     ` Herbert Euler
2007-04-26  6:17     ` martin rudalics
2007-04-26 14:04       ` Stefan Monnier
2007-04-26 15:06         ` Herbert Euler [this message]
2007-04-26 16:00           ` Stefan Monnier
2007-04-26 15:51         ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BAY143-F291208A268E705C0F65780DA480@phx.gbl \
    --to=herberteuler@hotmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).