help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Font-Locking for Allout Mode


From: Tassilo Horn
Subject: Re: Font-Locking for Allout Mode
Date: Fri, 09 Mar 2007 15:27:13 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.95 (gnu/linux)

Stephen Berman <address@hidden> 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:
>
> (defvar th-allout-font-lock-keywords
>   '((eval . (list (concat "^\\(?:" allout-regexp "\\).+")
>                 0 '(cond ((= (allout-depth) 1)
>                           '(1 . font-lock-function-name-face))
>                          ((= (allout-depth) 2)
>                           '(2 . font-lock-variable-name-face))
>                          ((= (allout-depth) 3)
>                           '(3 . font-lock-keyword-face))
>                          ((= (allout-depth) 4)
>                           '(4 . font-lock-builtin-face))
>                          ((= (allout-depth) 5)
>                           '(5 . font-lock-comment-face))
>                          ((= (allout-depth) 6)
>                           '(6 . font-lock-constant-face))
>                          ((= (allout-depth) 7)
>                           '(7 . font-lock-type-face))
>                          ((= (allout-depth) 8)
>                           '(8 . font-lock-string-face))
>                          (t font-lock-warning-face))
>                 t nil)))
>   "Additional expressions to highlight in Allout mode.")

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 still don't understand why the other version doesn't work with Emacs
> lisp mode while the above does. 

I don't, too.

> Another puzzling thing is that with the above, allout fontification
> works in Emacs lisp mode even without the file local variable "mode:
> allout"; however, in text mode that file local variable is still
> needed to get the allout fontification.

I can confirm this behavior.

> So there are still some problems with the code, but we've made
> progress. :-)

Indeed. Thanks a lot.

Bye,
Tassilo 


reply via email to

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