emacs-devel
[Top][All Lists]
Advanced

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

Re: diary font-lock issue


From: Glenn Morris
Subject: Re: diary font-lock issue
Date: Wed, 17 May 2006 15:11:54 -0400
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

Thank you Stefan and Martin, I see now what the problem is. The
information is basically in the elisp manual, so I should have been
able to figure it out, sorry.

Stefan Monnier wrote:

> (defun foo-font-lock-fontify-region-function (beg end &optional loudly)
>   (goto-char beg)
>   (forward-line 0)
>   (if (looking-at "=+$") (setq beg (line-beginning-position 0)))
>   (goto-char end)
>   (unless (bolp) (forward-line 1))
>   (if (looking-at "=+$") (setq end (line-beginning-position 2)))
>   (font-lock-default-fontify-region beg end loudly))

One thing I don't get about this - it looks like I can't rely on
font-lock regions beginning/ending at the start of lines. Given that,
how does normal jit-font-locking of non-multiline keywords work, since
regions could start/end in the middle of keywords? Is there always one
or more overlap line between neighbouring font-lock regions or
something? I guess this is the reason I don't need to make any region
adjustments on the first line of my multiline pattern.





reply via email to

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