From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.devel Subject: Re: diary font-lock issue Date: Wed, 17 May 2006 15:11:54 -0400 Message-ID: References: <8jwtcmqvqm.fsf@fencepost.gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1147893151 25299 80.91.229.2 (17 May 2006 19:12:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 17 May 2006 19:12:31 +0000 (UTC) Cc: Glenn Morris , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 17 21:12:29 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FgRRN-00010g-1J for ged-emacs-devel@m.gmane.org; Wed, 17 May 2006 21:12:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FgRRM-0007kQ-CO for ged-emacs-devel@m.gmane.org; Wed, 17 May 2006 15:12:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FgRR6-0007gX-Ia for emacs-devel@gnu.org; Wed, 17 May 2006 15:11:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FgRR5-0007fO-CE for emacs-devel@gnu.org; Wed, 17 May 2006 15:11:55 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FgRR5-0007fF-8x for emacs-devel@gnu.org; Wed, 17 May 2006 15:11:55 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FgRU0-00024Q-MP for emacs-devel@gnu.org; Wed, 17 May 2006 15:14:56 -0400 Original-Received: from localhost ([127.0.0.1]) by fencepost.gnu.org with esmtp (Exim 4.34) id 1FgRR4-00049y-Gd; Wed, 17 May 2006 15:11:54 -0400 Original-To: Stefan Monnier X-Spook: USDOJ passwd ASDIC JFK SWAT mindwar fraud NWO X-Ran: [(TM(x}x8*3{}'>n:S?PXM@iGzB3$i"^pV-xP+qg4&c3,#"EVAt0m6x51;H5&Jsv"!oQ+a X-Hue: cyan X-Attribution: GM In-Reply-To: (Stefan Monnier's message of "Wed, 17 May 2006 11:05:38 -0400") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) 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:54642 Archived-At: 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.