From: "Ulf Andersson" <ulf.andersson7@telia.com>
Subject: Re: font-lock and fontifying the few first nonempty lines in a buffer
Date: Fri, 27 Jun 2003 10:43:30 GMT [thread overview]
Message-ID: <mdVKa.17879$dP1.33296@newsc.telia.net> (raw)
In-Reply-To: 3EFB8125.6090600@yahoo.com
Thank's Kevin for the sugestion.
I realise that I failed to mention everything. I'm sorry.
The text header consists of the first nonempty lines in the buffer. The header
is followed by at least one empty line.
I tried to use a slightly modified version of your regexp,
"\\`\\(\\(.+\n\\)\\{1,7\\}\\)\n"
And it does indeed color the header correctly some times, but not always.
The documentation for font-lock also says that "keywords", i.e. regexps
in the `font-lock-keywords' variable, should not span several lines, as
this is "unreliable", to use the Elisp manual's word.
This lead us back to square one, I'm afraid.
Best regards to you all.
/Ulf Andersson
"Kevin Rodgers" <ihs_4664@yahoo.com> wrote in message
news:3EFB8125.6090600@yahoo.com...
>
> If you need a regexp that matches 3 non-empty lines at the beginning of
> the buffer:
>
> interactively
> programatically
> -------------
> ---------------
> \`\(.+ C-q C-j \)\{3\} "\\`\\(.+\n\\)\\{3\\}"
>
> (If you need a regexp that matches the first 3 lines in the buffer,
> replace + by *.)
>
> If you need a regexp that matches the first 3 non-empty lines in the buffer:
>
> interactively
> programatically
> -------------
> ---------------
> M-<
> (goto-char (point-min))
> \(^$\)*\(.+ C-q C-q \)\{3\} "\\(^$\\)*\\(.+\n\\)\\{3\\}"
>
> --
> <a href="mailto:<kevin.rodgers@ihs.com>">Kevin Rodgers</a>
>
next prev parent reply other threads:[~2003-06-27 10:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-26 20:47 font-lock and fontifying the few first nonempty lines in a buffer Ulf Andersson
2003-06-26 23:26 ` Kevin Rodgers
2003-06-27 10:43 ` Ulf Andersson [this message]
2003-06-27 12:44 ` Kai Großjohann
2003-06-27 14:41 ` Ulf Andersson
2003-06-27 15:15 ` Kai Großjohann
2003-06-27 16:54 ` Stefan Monnier
2003-06-28 1:01 ` Sandip Chitale
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='mdVKa.17879$dP1.33296@newsc.telia.net' \
--to=ulf.andersson7@telia.com \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.