unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Glenn Morris <rgm@gnu.org>
Cc: Glenn Morris <rgm@gnu.org>, emacs-devel@gnu.org
Subject: Re: diary font-lock issue
Date: Wed, 17 May 2006 15:11:54 -0400	[thread overview]
Message-ID: <qb8xp0qxdx.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <jwvr72ssno2.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Wed, 17 May 2006 11:05:38 -0400")


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	other threads:[~2006-05-17 19:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-16  7:22 diary font-lock issue Glenn Morris
2006-05-16 15:50 ` martin rudalics
2006-05-16 17:56   ` Glenn Morris
2006-05-16 21:42     ` martin rudalics
2006-05-17 15:11     ` Stefan Monnier
2006-05-17 15:05 ` Stefan Monnier
2006-05-17 19:11   ` Glenn Morris [this message]
2006-05-17 21:15     ` Stefan Monnier
2006-05-21 10:39   ` 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=qb8xp0qxdx.fsf@fencepost.gnu.org \
    --to=rgm@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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).