[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: font-lock-number-face
From: |
Ritchie |
Subject: |
Re: font-lock-number-face |
Date: |
Sat, 27 Nov 2010 12:05:48 -0800 (PST) |
User-agent: |
G2/1.0 |
On Nov 5, 2:31 am, Sébastien Vauban <wxhgmqzgw...@spammotel.com>
wrote:
> Hi Ritchie,
>
>
>
>
>
>
>
>
>
> Ritchie wrote:
> > I'm trying to add a new face in my config file so that all the numbers
> > will have different color. Here is what I have:
>
> > (make-face 'font-lock-number-face)
> > (set-face-foreground 'font-lock-number-face"DodgerBlue4")
> > (setqfont-lock-number-face'font-lock-number-face)
> > (defvar font-lock-number "[0-9]+\\([eE][+-]?[0-9]*\\)?")
> > (defvar font-lock-hexnumber "0[xX][0-9a-fA-F]+")
>
> > (add-hook 'font-lock-mode-hook
> > #'(lambda ()
> > (setq font-lock-keywords
> > (append font-lock-keywords
> > (list
> > (list (concat "\\<\\(" font-lock-number "\
> > \)\\>" )
> > (list 0font-lock-number-face))
> > (list (concat "\\<\\(" font-lock-
> > hexnumber "\\)\\>" )
> > (list 0font-lock-number-face))
> > )))))
>
> > This works fine for most modes, except multi-term.
>
> This looks really nice. But, when enabling it, my Gnus buffer become black and
> white only. Not true: I see your blue face for the numbers, but every other
> color customization is gone.
>
> Some sort of conflict between the color-theme and this? Priority? Not
> cumulative?
>
> Best regards,
> Seb
>
> --
> Sébastien Vauban
Yeah, it looks pretty nice in most modes, e.g. cc-mode, python-mode,
etc., except multi-term, which I think uses term-mode. I'm just trying
to turn font-lock-number-face to default automatically, while running
multi-term. Not sure how to do that yet.
regards
Ritchie