all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Font-Locking for Allout Mode
@ 2007-03-07 20:07 Tassilo Horn
  2007-03-08 13:23 ` Stephen Berman
       [not found] ` <mailman.654.1173360249.7795.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 18+ messages in thread
From: Tassilo Horn @ 2007-03-07 20:07 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

I'm a new user of allout-mode and I really like it. The only thing that
has to be improved is the readability of the headings. I would like to
use font locking to adjust the faces like the AUCTeX sectioning faces.

On EmacsWiki [1] I found some snippets for doing that, although the
first one seems to be outline-mode specific. So I adapted it for allout
mode and came up with this:

,----[ ~/.emacs ]
| (defvar th-allout-font-lock-keywords
|   '(;; Highlight headings according to the level.
|     (eval . (list (concat "^\\(" allout-regexp "\\).+")
|                 0 '(or (cdr (assq (allout-depth)
|                                   '((1 . font-lock-function-name-face)
|                                     (2 . font-lock-variable-name-face)
|                                     (3 . font-lock-keyword-face)
|                                     (4 . font-lock-builtin-face)
|                                     (5 . font-lock-comment-face)
|                                     (6 . font-lock-constant-face)
|                                     (7 . font-lock-type-face)
|                                     (8 . font-lock-string-face))))
|                        font-lock-warning-face)
|                 nil t)))
|   "Additional expressions to highlight in Allout mode.")
| 
| (defun th-font-lock-allout ()
|   (interactive)
|   (font-lock-add-keywords nil th-allout-font-lock-keywords))
| 
| (add-hook 'allout-mode-hook
|           'th-font-lock-allout)
`----

But it seems to have no effect. The regexp from above is

"^\\(\\(;;;_[ 	]*[\\.,\\*\\+--=>()\\[{}&!\\?#%\"X@\\$~_\\\\:;\\^;;;_]\\)\\|\\(;;;_\\|;;;_\\)+ ?[^;;;_]\\|\f\\).+"

It is for allout mode in a emacs lisp buffer. If I enter it in
`re-builder' it matches the allout topic headings just fine.

Can anyone see what's wrong with the code?

Thanks in advance,
Tassilo

Footnotes: 
[1] http://www.emacswiki.org/cgi-bin/wiki/AllOut
-- 
The glass is neither half-full nor half-empty: it's twice as big as it
needs to be.

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2007-03-11 15:07 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.