From: Stephen Berman <Stephen.Berman@gmx.net>
To: help-gnu-emacs@gnu.org
Subject: Re: Font-Locking for Allout Mode
Date: Sun, 11 Mar 2007 16:07:53 +0100 [thread overview]
Message-ID: <87r6rvn7hy.fsf@escher.local.home> (raw)
In-Reply-To: 87odn2bbtf.fsf@escher.local.home
On Fri, 09 Mar 2007 17:50:52 +0100 Stephen Berman
<Stephen.Berman@gmx.net> wrote:
> On Fri, 09 Mar 2007 15:27:13 +0100 Tassilo Horn
> <tassilo@member.fsf.org> wrote:
>
>> Stephen Berman <Stephen.Berman@gmx.net> writes:
>>
>> Hi Stephen,
>>
>>> Our discussion convinced me that the code from the Emacs wiki wasn't
>>> playing well with Emacs lisp mode, so I fiddled with it and came up
>>> with a variant that works in Emacs lisp mode. Replace your
>>> th-allout-font-lock-keywords with the following:
> [...]
>> Yes, now it works. But I get a lot of the messages below in *Messages*:
>>
>> ,----
>> | Invalid face reference: 2
>> | Invalid face reference: 1 [9 times]
>> | Invalid face reference: 2 [2 times]
>> `----
>
> I didn't notice them before, but I get them too. The message comes
> from merge_face_ref in xfaces.c, and a comment there says: "FACE_REF
> ought to be a face name." This apparently means that the face
> specification I gave is flawed, although the results look ok. But I'm
> afraid I'm out of my depth here. If we're lucky some font-lock guru
> will notice this thread and help us.
Font-Lock guru Stefan Monnier's post provided the necessary help,
though my first attempt to make use of it was wrong. But the
following works and uses valid face references:
(defvar srb-allout-font-lock-keywords
'((eval . (list (concat "^\\(?:" allout-regexp "\\).+")
0 '(cond ((= (allout-depth) 1)
font-lock-function-name-face)
((= (allout-depth) 2)
font-lock-variable-name-face)
((= (allout-depth) 3)
font-lock-keyword-face)
((= (allout-depth) 4)
font-lock-builtin-face)
((= (allout-depth) 5)
font-lock-comment-face)
((= (allout-depth) 6)
font-lock-constant-face)
((= (allout-depth) 7)
font-lock-type-face)
((= (allout-depth) 8)
font-lock-string-face)
(t font-lock-warning-face))
t nil)))
"Additional expressions to highlight in Allout mode.")
Steve Berman
next prev parent reply other threads:[~2007-03-11 15:07 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-07 20:07 Font-Locking for Allout Mode Tassilo Horn
2007-03-08 13:23 ` Stephen Berman
[not found] ` <mailman.654.1173360249.7795.help-gnu-emacs@gnu.org>
2007-03-08 14:03 ` Tassilo Horn
2007-03-08 16:06 ` Stephen Berman
[not found] ` <mailman.663.1173370034.7795.help-gnu-emacs@gnu.org>
2007-03-08 16:42 ` Tassilo Horn
2007-03-08 22:38 ` Peter Dyballa
2007-03-08 22:45 ` Stephen Berman
[not found] ` <mailman.686.1173393546.7795.help-gnu-emacs@gnu.org>
2007-03-08 22:49 ` Tassilo Horn
[not found] ` <mailman.687.1173393945.7795.help-gnu-emacs@gnu.org>
2007-03-08 23:18 ` Tassilo Horn
2007-03-09 11:28 ` Stephen Berman
[not found] ` <mailman.704.1173439750.7795.help-gnu-emacs@gnu.org>
2007-03-09 14:27 ` Tassilo Horn
2007-03-09 16:50 ` Stephen Berman
2007-03-11 15:07 ` Stephen Berman [this message]
2007-03-09 20:36 ` Stefan Monnier
2007-03-09 21:44 ` Tassilo Horn
2007-03-09 23:34 ` Stephen Berman
2007-03-09 23:47 ` Stephen Berman
2007-03-11 15:07 ` Stephen Berman
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=87r6rvn7hy.fsf@escher.local.home \
--to=stephen.berman@gmx.net \
--cc=help-gnu-emacs@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 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.